Code

remove many unnecessary to_2geom and from_2geom calls
[inkscape.git] / src / dialogs / clonetiler.cpp
index b0bc44bd7e4355bd7de2c34f159b35c01d643819..048635bb97cca014489778b7cc5aa2e08f3ebacc 100644 (file)
@@ -68,7 +68,7 @@ static win_data wd;
 
 // impossible original values to make sure they are read from prefs
 static gint x = -1000, y = -1000, w = 0, h = 0;
-static gchar *prefs_path = "dialogs.clonetiler";
+static gchar const *prefs_path = "dialogs.clonetiler";
 
 #define SB_MARGIN 1
 #define VB_MARGIN 4
@@ -1239,13 +1239,11 @@ clonetiler_apply( GtkWidget */*widget*/, void * )
         x0 = sp_repr_get_double_attribute (obj_repr, "inkscape:tile-x0", 0);
         y0 = sp_repr_get_double_attribute (obj_repr, "inkscape:tile-y0", 0);
     } else {
-        NR::Maybe<NR::Rect> r = SP_ITEM(obj)->getBounds(sp_item_i2doc_affine(SP_ITEM(obj)),
-                                                        SPItem::GEOMETRIC_BBOX);
-        /* impl: Use of GEOMETRIC_BBOX is so that the stroke of rectangles will be shared
-         * (overlapped) rather than effectively doubled in width.
-         *
-         * (If you wish to change this, then please consider discussing at bug #1722238.) */
-
+        int prefs_bbox = prefs_get_int_attribute("tools", "bounding_box", 0);
+        SPItem::BBoxType bbox_type = (prefs_bbox ==0)? 
+            SPItem::APPROXIMATE_BBOX : SPItem::GEOMETRIC_BBOX;
+        boost::optional<NR::Rect> r = SP_ITEM(obj)->getBounds(sp_item_i2doc_affine(SP_ITEM(obj)),
+                                                        bbox_type);
         if (r) {
             w = r->dimensions()[NR::X];
             h = r->dimensions()[NR::Y];