From b1e8887aa3ba9ab7711b443fd73f94b293447c95 Mon Sep 17 00:00:00 2001 From: bulia byak Date: Wed, 22 Mar 2006 18:25:58 +0000 Subject: optimization: prevent taking bbox twice of the first object in selection (bzr r271) --- src/selection.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/selection.cpp') diff --git a/src/selection.cpp b/src/selection.cpp index 87e0788d8..763713c9d 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -303,8 +303,10 @@ NR::Rect Selection::bounds() const GSList const *i = items; NR::Rect bbox = sp_item_bbox_desktop(SP_ITEM(i->data)); + GSList const *i_start = i; while (i != NULL) { - bbox = NR::Rect::union_bounds(bbox, sp_item_bbox_desktop(SP_ITEM(i->data))); + if (i != i_start) + bbox = NR::Rect::union_bounds(bbox, sp_item_bbox_desktop(SP_ITEM(i->data))); i = i->next; } -- cgit v1.2.3