Code

use the user-specified bounding box type
authorbuliabyak <buliabyak@users.sourceforge.net>
Thu, 17 Apr 2008 02:41:01 +0000 (02:41 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Thu, 17 Apr 2008 02:41:01 +0000 (02:41 +0000)
src/widgets/select-toolbar.cpp

index f996abe7a062a83028e5b70b3e6503f62986044b..825bd7ac158829c2095df1c1a747d5298f9c4d3c 100644 (file)
@@ -64,7 +64,10 @@ sp_selection_layout_widget_update(SPWidget *spw, Inkscape::Selection *sel)
     using NR::X;
     using NR::Y;
     if ( sel && !sel->isEmpty() ) {
-        NR::Maybe<NR::Rect> const bbox(sel->bounds());
+        int prefs_bbox = prefs_get_int_attribute("tools", "bounding_box", 0);
+        SPItem::BBoxType bbox_type = (prefs_bbox ==0)? 
+            SPItem::APPROXIMATE_BBOX : SPItem::GEOMETRIC_BBOX;
+        NR::Maybe<NR::Rect> const bbox(sel->bounds(bbox_type));
         if ( bbox && !bbox->isEmpty() ) {
             UnitTracker *tracker = reinterpret_cast<UnitTracker*>(g_object_get_data(G_OBJECT(spw), "tracker"));
             SPUnit const &unit = *tracker->getActiveUnit();
@@ -151,7 +154,10 @@ sp_object_layout_any_value_changed(GtkAdjustment *adj, SPWidget *spw)
     SPDocument *document = sp_desktop_document(desktop);
 
     sp_document_ensure_up_to_date (document);
-    NR::Maybe<NR::Rect> bbox = selection->bounds();
+    int prefs_bbox = prefs_get_int_attribute("tools", "bounding_box", 0);
+    SPItem::BBoxType bbox_type = (prefs_bbox ==0)? 
+        SPItem::APPROXIMATE_BBOX : SPItem::GEOMETRIC_BBOX;
+    NR::Maybe<NR::Rect> bbox = selection->bounds(bbox_type);
 
     if ( !bbox || bbox->isEmpty() ) {
         g_object_set_data(G_OBJECT(spw), "update", GINT_TO_POINTER(FALSE));