From 69ba226147751a529c9561925b2737fa3071ecd2 Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Sat, 3 Dec 2016 20:05:32 +0100 Subject: Improvements and fixes for buds pointed by suv on measure line LPE (bzr r15294) --- src/sp-lpe-item.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/sp-lpe-item.cpp') diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index 8f0713652..ae29137e6 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -514,6 +514,21 @@ void SPLPEItem::removeCurrentPathEffect(bool keep_paths) */ void SPLPEItem::removeAllPathEffects(bool keep_paths) { + if (keep_paths) { + if (path_effect_list->empty()) { + return; + } + + for (PathEffectList::const_iterator it = path_effect_list->begin(); it != path_effect_list->end(); ++it) + { + LivePathEffectObject *lpeobj = (*it)->lpeobject; + if (lpeobj) { + Inkscape::LivePathEffect::Effect * lpe = lpeobj->get_lpe(); + lpe->erase_extra_objects = false; + } + } + } + this->getRepr()->setAttribute("inkscape:path-effect", NULL); if (!keep_paths) { -- cgit v1.2.3 From f799b5d6e8278c76326a6fec8da0e017eac342ec Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Tue, 6 Dec 2016 21:41:55 +0100 Subject: Fixes for measure LPE and speed path based LPE operations (bzr r15302) --- src/sp-lpe-item.cpp | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'src/sp-lpe-item.cpp') diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index ae29137e6..872a88289 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -289,22 +289,6 @@ sp_lpe_item_update_patheffect (SPLPEItem *lpeitem, bool wholetree, bool write) if (!lpeitem->pathEffectsEnabled()) return; - // TODO: hack! this will be removed when path length measuring is reimplemented in a better way - PathEffectList lpelist = lpeitem->getEffectList(); - std::list::iterator i; - for (i = lpelist.begin(); i != lpelist.end(); ++i) { - if ((*i)->lpeobject) { - Inkscape::LivePathEffect::Effect *lpe = (*i)->lpeobject->get_lpe(); - if (dynamic_cast(lpe)) { - if (!lpe->isVisible()) { - // we manually disable text for LPEPathLength - // use static_cast, because we already checked for the right type above - static_cast(lpe)->hideCanvasText(); - } - } - } - } - SPLPEItem *top = NULL; if (wholetree) { -- cgit v1.2.3 From 6586a50de3ad7f47a895f904ff66cc6613d62124 Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Wed, 7 Dec 2016 23:17:49 +0100 Subject: Improve measure line to allow similar LPE (bzr r15310) --- src/sp-lpe-item.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/sp-lpe-item.cpp') diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index 872a88289..e2f61bfb5 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -125,7 +125,8 @@ void SPLPEItem::set(unsigned int key, gchar const* value) { { if (!value) { LivePathEffectObject *lpeobj = (*it)->lpeobject; - if (Inkscape::LivePathEffect::LPEMeasureLine * lpe = dynamic_cast(lpeobj->get_lpe())) { + Inkscape::LivePathEffect::Effect * lpe = lpeobj->get_lpe(); + if (dynamic_cast(lpe)){ lpe->doOnRemove(this); } } -- cgit v1.2.3