diff options
| author | MenTaLguY <mental@rydia.net> | 2007-03-04 19:06:11 +0000 |
|---|---|---|
| committer | mental <mental@users.sourceforge.net> | 2007-03-04 19:06:11 +0000 |
| commit | 99fe98445f78d07574fcf3a4a0243bff9097fdf5 (patch) | |
| tree | c5d9561625928907ca56505e6fa672108f2ffeef /src/splivarot.cpp | |
| parent | implement new API via wrapper for now (diff) | |
| download | inkscape-99fe98445f78d07574fcf3a4a0243bff9097fdf5.tar.gz inkscape-99fe98445f78d07574fcf3a4a0243bff9097fdf5.zip | |
switch from invokeBbox to getBounds (need to fix problems with empty
rect handling, though)
(bzr r2536)
Diffstat (limited to 'src/splivarot.cpp')
| -rw-r--r-- | src/splivarot.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
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; } |
