From 7bedd224ace433cf4c1a829ba38f6a3c388227e6 Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Thu, 5 Jan 2017 20:03:50 +0100 Subject: Adding base (bzr r15392.1.1) --- src/sp-item-group.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/sp-item-group.cpp') diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index 7b2507b5e..b9a8fb83f 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -925,6 +925,15 @@ void SPGroup::update_patheffect(bool write) { } sp_group_perform_patheffect(this, this, write); + + for (PathEffectList::iterator it = this->path_effect_list->begin(); it != this->path_effect_list->end(); ++it) + { + LivePathEffectObject *lpeobj = (*it)->lpeobject; + + if (lpeobj && lpeobj->get_lpe()) { + lpeobj->get_lpe()->doAfterEffect(this); + } + } } } -- cgit v1.2.3 From e06fb0c25cc352df40b77a1988b5045426e7ef2d Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Tue, 24 Jan 2017 01:02:46 +0100 Subject: Fixing to merge (bzr r15392.1.8) --- src/sp-item-group.cpp | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) (limited to 'src/sp-item-group.cpp') diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index b9a8fb83f..70787708e 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -959,25 +959,36 @@ sp_group_perform_patheffect(SPGroup *group, SPGroup *topgroup, bool write) } else { c = subShape->getCurve(); } - + bool success = false; // only run LPEs when the shape has a curve defined if (c) { c->transform(i2anc_affine(subitem, topgroup)); - topgroup->performPathEffect(c); + success = topgroup->performPathEffect(c, subShape); c->transform(i2anc_affine(subitem, topgroup).inverse()); - subShape->setCurve(c, TRUE); - if (write) { - Inkscape::XML::Node *repr = subitem->getRepr(); - gchar *str = sp_svg_write_path(c->get_pathvector()); - repr->setAttribute("d", str); -#ifdef GROUP_VERBOSE - g_message("sp_group_perform_patheffect writes 'd' attribute"); -#endif - g_free(str); + if (c && success) { + subShape->setCurve(c, TRUE); + if (write) { + Inkscape::XML::Node *repr = subitem->getRepr(); + gchar *str = sp_svg_write_path(c->get_pathvector()); + repr->setAttribute("d", str); + #ifdef GROUP_VERBOSE + g_message("sp_group_perform_patheffect writes 'd' attribute"); + #endif + g_free(str); + } + c->unref(); + } else { + // LPE was unsuccesfull or doeffect stack return null. Read the old 'd'-attribute. + if (gchar const * value = repr->attribute("d")) { + Geom::PathVector pv = sp_svg_read_pathv(value); + SPCurve *oldcurve = new (std::nothrow) SPCurve(pv); + if (oldcurve) { + subShape->setCurve(oldcurve, TRUE); + oldcurve->unref(); + } + } } - - c->unref(); } } } -- cgit v1.2.3 From 6569c9330cb3f5378d01c4fe43c13f69d537561e Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Tue, 24 Jan 2017 08:17:30 +0100 Subject: Bug fixes (bzr r15392.1.11) --- src/sp-item-group.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/sp-item-group.cpp') diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index 70787708e..f2c0d2f2c 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -965,16 +965,15 @@ sp_group_perform_patheffect(SPGroup *group, SPGroup *topgroup, bool write) c->transform(i2anc_affine(subitem, topgroup)); success = topgroup->performPathEffect(c, subShape); c->transform(i2anc_affine(subitem, topgroup).inverse()); - + Inkscape::XML::Node *repr = subitem->getRepr(); if (c && success) { subShape->setCurve(c, TRUE); if (write) { - Inkscape::XML::Node *repr = subitem->getRepr(); gchar *str = sp_svg_write_path(c->get_pathvector()); repr->setAttribute("d", str); - #ifdef GROUP_VERBOSE +#ifdef GROUP_VERBOSE g_message("sp_group_perform_patheffect writes 'd' attribute"); - #endif +#endif g_free(str); } c->unref(); -- cgit v1.2.3