From 99fe98445f78d07574fcf3a4a0243bff9097fdf5 Mon Sep 17 00:00:00 2001 From: MenTaLguY Date: Sun, 4 Mar 2007 19:06:11 +0000 Subject: switch from invokeBbox to getBounds (need to fix problems with empty rect handling, though) (bzr r2536) --- src/splivarot.cpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'src/splivarot.cpp') diff --git a/src/splivarot.cpp b/src/splivarot.cpp index e5154c130..ecafd2f04 100644 --- a/src/splivarot.cpp +++ b/src/splivarot.cpp @@ -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; } -- cgit v1.2.3