From acd2b4faf158617bba6ff9dd5f24dac7a44c8d01 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Wed, 22 Mar 2006 18:25:58 +0000 Subject: [PATCH] optimization: prevent taking bbox twice of the first object in selection --- src/selection.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- 2.30.2