From 8417209743e184c46d7ec845928bfbee5f8d8d77 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sun, 8 Apr 2007 21:07:29 +0000 Subject: Changes to the selector tool, e.g. option to choose either APPROXIMATE_BBOX or GEOMETRIC_BBOX (bzr r2833) --- src/selection.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/selection.cpp') diff --git a/src/selection.cpp b/src/selection.cpp index 05bd8d030..44f601362 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -304,25 +304,25 @@ Inkscape::XML::Node *Selection::singleRepr() { return obj ? SP_OBJECT_REPR(obj) : NULL; } -NRRect *Selection::bounds(NRRect *bbox) const +NRRect *Selection::bounds(NRRect *bbox, SPItem::BBoxType type) const { g_return_val_if_fail (bbox != NULL, NULL); - *bbox = NRRect(bounds()); + *bbox = NRRect(bounds(type)); return bbox; } -NR::Maybe Selection::bounds() const +NR::Maybe Selection::bounds(SPItem::BBoxType type) const { GSList const *items = const_cast(this)->itemList(); NR::Maybe bbox = NR::Nothing(); for ( GSList const *i = items ; i != NULL ; i = i->next ) { - bbox = NR::union_bounds(bbox, sp_item_bbox_desktop(SP_ITEM(i->data))); + bbox = NR::union_bounds(bbox, sp_item_bbox_desktop(SP_ITEM(i->data), type)); } return bbox; } -NRRect *Selection::boundsInDocument(NRRect *bbox) const { +NRRect *Selection::boundsInDocument(NRRect *bbox, SPItem::BBoxType type) const { g_return_val_if_fail (bbox != NULL, NULL); GSList const *items=const_cast(this)->itemList(); @@ -336,16 +336,16 @@ NRRect *Selection::boundsInDocument(NRRect *bbox) const { for ( GSList const *iter=items ; iter != NULL ; iter = iter->next ) { SPItem *item=SP_ITEM(iter->data); - NR::Matrix const i2doc(sp_item_i2doc_affine(item)); - sp_item_invoke_bbox(item, bbox, i2doc, FALSE); + NR::Matrix i2doc(sp_item_i2doc_affine(item)); + sp_item_invoke_bbox(item, bbox, i2doc, FALSE, type); } return bbox; } -NR::Maybe Selection::boundsInDocument() const { +NR::Maybe Selection::boundsInDocument(SPItem::BBoxType type) const { NRRect r; - return boundsInDocument(&r)->upgrade(); + return boundsInDocument(&r, type)->upgrade(); } /** Extract the position of the center from the first selected object */ -- cgit v1.2.3