summaryrefslogtreecommitdiffstats
path: root/src/sp-item-group.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2017-01-24 08:41:37 +0000
committerjabiertxof <info@marker.es>2017-01-24 08:41:37 +0000
commit2db253e38b7ac8f00ca607ff1d69e15b61301389 (patch)
tree3177b769003d4fba36f20364720ab7cd8e3a4db3 /src/sp-item-group.cpp
parentfix nodes reverting back during editing (diff)
parentBug fixes (diff)
downloadinkscape-2db253e38b7ac8f00ca607ff1d69e15b61301389.tar.gz
inkscape-2db253e38b7ac8f00ca607ff1d69e15b61301389.zip
merge lp:~inkscape.dev/inkscape/rotatecopies_improvements
(bzr r15436)
Diffstat (limited to 'src/sp-item-group.cpp')
-rw-r--r--src/sp-item-group.cpp43
1 files changed, 31 insertions, 12 deletions
diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp
index 7b2507b5e..f2c0d2f2c 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);
+ }
+ }
}
}
@@ -950,25 +959,35 @@ 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);
+ Inkscape::XML::Node *repr = subitem->getRepr();
+ if (c && success) {
+ subShape->setCurve(c, TRUE);
+ if (write) {
+ 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");
+ g_message("sp_group_perform_patheffect writes 'd' attribute");
#endif
- g_free(str);
+ 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();
}
}
}