Code

optimization: prevent taking bbox twice of the first object in selection
authorbuliabyak <buliabyak@users.sourceforge.net>
Wed, 22 Mar 2006 18:25:58 +0000 (18:25 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Wed, 22 Mar 2006 18:25:58 +0000 (18:25 +0000)
src/selection.cpp

index 87e0788d888e042b7cb452f604d57c0b1df0f1d8..763713c9d86923e0242f6399429fb41f01d77313 100644 (file)
@@ -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;
     }