Code

switch from invokeBbox to getBounds (need to fix problems with empty
[inkscape.git] / src / splivarot.cpp
index e5154c130b3bd504988d7a12de0f054ace327639..ecafd2f04e9eeee17d22d58608f8943bf2d77e9d 100644 (file)
@@ -474,7 +474,11 @@ sp_selected_path_boolop(bool_op bop, const unsigned int verb, const Glib::ustrin
     // premultiply by the inverse of parent's repr
     SPItem *parent_item = SP_ITEM(sp_desktop_document(desktop)->getObjectByRepr(parent));
     NR::Matrix local = sp_item_i2doc_affine(parent_item);
-    gchar *transform = sp_svg_transform_write(local);
+    gchar affinestr[80];
+    gchar *transform = NULL;
+    if (!local.test_identity() && sp_svg_transform_write(affinestr, 79, local.inverse())) {
+        transform = affinestr;
+    }
 
     // now that we have the result, add it on the canvas
     if ( bop == bool_op_cut || bop == bool_op_slice ) {
@@ -571,8 +575,6 @@ sp_selected_path_boolop(bool_op bop, const unsigned int verb, const Glib::ustrin
         Inkscape::GC::release(repr);
     }
 
-    g_free(transform);
-
     sp_document_done(sp_desktop_document(desktop), verb, description);
 
     delete res;
@@ -1572,7 +1574,7 @@ sp_selected_path_simplify_items(SPDesktop *desktop,
           continue;
 
       if (simplifyIndividualPaths) {
-          NR::Rect itemBbox = item->invokeBbox(sp_item_i2d_affine(item));        
+          NR::Rect itemBbox = item->getBounds(sp_item_i2d_affine(item));        
           simplifySize      = L2(itemBbox.dimensions());
       }
 
@@ -1721,17 +1723,6 @@ Path_for_item(SPItem *item, bool doTransformation, bool transformFull)
         bpath=SP_CURVE_BPATH(curve);
     }
 
-    Path *dest = bpath_to_Path(bpath);
-
-    if ( doTransformation ) {
-        if ( bpath ) g_free(bpath);
-    } else {
-        sp_curve_unref(curve);
-    }
-    return dest;
-}
-
-Path *bpath_to_Path(NArtBpath const *bpath) {
     Path *dest = new Path;
     dest->SetBackData(false);
     {
@@ -1785,6 +1776,12 @@ Path *bpath_to_Path(NArtBpath const *bpath) {
         if (closed)
             dest->Close();
     }
+
+    if ( doTransformation ) {
+        if ( bpath ) g_free(bpath);
+    } else {
+        sp_curve_unref(curve);
+    }
     return dest;
 }