From 8b26a533c4d17e09575abd9bef1e13bd6e6e23d1 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 28 Apr 2014 21:51:55 +0200 Subject: when removing LPE, with 'flattening' option, don't recalculate/rewrite ellipses (which would remove the LPE result). fixes bug introduced in rev. 12670) Fixed bugs: - https://launchpad.net/bugs/1309631 (bzr r13321) --- src/sp-lpe-item.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index f59bc33ee..b5dd74fc6 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -442,6 +442,9 @@ void SPLPEItem::addPathEffect(LivePathEffectObject * new_lpeobj) g_free(hrefstr); } +/** + * If keep_path == true, the item should not be updated, effectively 'flattening' the LPE. + */ void SPLPEItem::removeCurrentPathEffect(bool keep_paths) { Inkscape::LivePathEffect::LPEObjectReference* lperef = this->getCurrentLPEReference(); @@ -456,27 +459,31 @@ void SPLPEItem::removeCurrentPathEffect(bool keep_paths) this->getRepr()->setAttribute("inkscape:path-effect", r.c_str()); } else { this->getRepr()->setAttribute("inkscape:path-effect", NULL); + } + + if (!keep_paths) { // Make sure that ellipse is stored as or if possible. if( SP_IS_GENERICELLIPSE(this)) { SP_GENERICELLIPSE(this)->write( this->getRepr()->document(), this->getRepr(), SP_OBJECT_WRITE_EXT ); } - } - if (!keep_paths) { sp_lpe_item_cleanup_original_path_recursive(this); } } +/** + * If keep_path == true, the item should not be updated, effectively 'flattening' the LPE. + */ void SPLPEItem::removeAllPathEffects(bool keep_paths) { this->getRepr()->setAttribute("inkscape:path-effect", NULL); - // Make sure that ellipse is stored as or if possible. - if( SP_IS_GENERICELLIPSE(this)) { - SP_GENERICELLIPSE(this)->write( this->getRepr()->document(), this->getRepr(), SP_OBJECT_WRITE_EXT ); - } - if (!keep_paths) { + // Make sure that ellipse is stored as or if possible. + if (SP_IS_GENERICELLIPSE(this)) { + SP_GENERICELLIPSE(this)->write(this->getRepr()->document(), this->getRepr(), SP_OBJECT_WRITE_EXT); + } + sp_lpe_item_cleanup_original_path_recursive(this); } } -- cgit v1.2.3