From e9e25c0f83f2bd149a63a11b0516b647e4082ed6 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Wed, 28 Mar 2018 19:27:59 +0200 Subject: Fix bug: 1758477 Rotate Duplicate/ Mirror Symmetry added functionality feature request https://bugs.launchpad.net/inkscape/+bug/1758477 --- src/object/sp-lpe-item.cpp | 10 ++++++++-- src/object/sp-path.cpp | 1 - src/object/sp-shape.cpp | 6 +----- src/ui/tools/arc-tool.cpp | 5 ++++- src/ui/tools/spiral-tool.cpp | 8 ++++++-- src/ui/tools/star-tool.cpp | 2 +- 6 files changed, 20 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/object/sp-lpe-item.cpp b/src/object/sp-lpe-item.cpp index 17b2710f8..abe08a1dc 100644 --- a/src/object/sp-lpe-item.cpp +++ b/src/object/sp-lpe-item.cpp @@ -358,8 +358,14 @@ sp_lpe_item_create_original_path_recursive(SPLPEItem *lpeitem) } else if (SPPath * path = dynamic_cast(lpeitem)) { Inkscape::XML::Node *pathrepr = path->getRepr(); if ( !pathrepr->attribute("inkscape:original-d") ) { - pathrepr->setAttribute("inkscape:original-d", pathrepr->attribute("d")); - path->setCurveBeforeLPE(path->getCurve()); + if (gchar const * value = pathrepr->attribute("d")) { + Geom::PathVector pv = sp_svg_read_pathv(value); + pathrepr->setAttribute("inkscape:original-d", value); + SPCurve * original = new SPCurve(); + original->set_pathvector(pv); + path->setCurveBeforeLPE(original); + original->unref(); + } } } else if (SPShape * shape = dynamic_cast(lpeitem)) { if (SPCurve * c_lpe = shape->getCurveBeforeLPE()) { diff --git a/src/object/sp-path.cpp b/src/object/sp-path.cpp index 3c64c09b0..a4724a8e7 100644 --- a/src/object/sp-path.cpp +++ b/src/object/sp-path.cpp @@ -199,7 +199,6 @@ void SPPath::set(unsigned int key, const gchar* value) { } sp_lpe_item_update_patheffect(this, true, true); - this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); break; case SP_ATTR_D: diff --git a/src/object/sp-shape.cpp b/src/object/sp-shape.cpp index 4af596d1e..df8a200d0 100644 --- a/src/object/sp-shape.cpp +++ b/src/object/sp-shape.cpp @@ -1068,7 +1068,7 @@ void SPShape::setCurveInsync(SPCurve *new_curve, unsigned int owner) /** * Return curve (if any exists) or NULL if there is no curve -* if owner == 0 return a copy + * if owner == 0 return a copy */ SPCurve * SPShape::getCurve(unsigned int owner) const { @@ -1084,8 +1084,6 @@ SPCurve * SPShape::getCurve(unsigned int owner) const /** * Return curve *before* LPE (if any exists) or NULL if there is no curve - * If force is set allow return curve_before_lpe even if not - * has path effect like in clips and mask * if owner == 0 return a copy */ SPCurve * SPShape::getCurveBeforeLPE(unsigned int owner) const @@ -1101,8 +1099,6 @@ SPCurve * SPShape::getCurveBeforeLPE(unsigned int owner) const /** * Return curve for edit - * If force is set allow return curve_before_lpe even if not - * has path effect like in clips and mask * if owner == 0 return a copy */ SPCurve * SPShape::getCurveForEdit(unsigned int owner) const diff --git a/src/ui/tools/arc-tool.cpp b/src/ui/tools/arc-tool.cpp index 34b29f3bb..c7243302b 100644 --- a/src/ui/tools/arc-tool.cpp +++ b/src/ui/tools/arc-tool.cpp @@ -424,7 +424,10 @@ void ArcTool::finishItem() { desktop->canvas->endForcedFullRedraws(); desktop->getSelection()->set(this->arc); - + if (this->arc->hasPathEffectRecursive()) { + this->arc->set_shape(); + sp_lpe_item_update_patheffect (this->arc, true, false); + } DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_ARC, _("Create ellipse")); this->arc = NULL; diff --git a/src/ui/tools/spiral-tool.cpp b/src/ui/tools/spiral-tool.cpp index 66779c3a1..ffca6ce4a 100644 --- a/src/ui/tools/spiral-tool.cpp +++ b/src/ui/tools/spiral-tool.cpp @@ -398,8 +398,12 @@ void SpiralTool::finishItem() { this->desktop->canvas->endForcedFullRedraws(); this->desktop->getSelection()->set(this->spiral); - this->desktop->getSelection()->set(this->spiral); - + + if (spiral->hasPathEffectRecursive()) { + this->spiral->set_shape(); + sp_lpe_item_update_patheffect (this->spiral, true, false); + } + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_SPIRAL, _("Create spiral")); this->spiral = NULL; diff --git a/src/ui/tools/star-tool.cpp b/src/ui/tools/star-tool.cpp index 9712bb7bd..586b7df38 100644 --- a/src/ui/tools/star-tool.cpp +++ b/src/ui/tools/star-tool.cpp @@ -417,11 +417,11 @@ void StarTool::finishItem() { this->star->set_shape(); this->star->updateRepr(SP_OBJECT_WRITE_EXT); this->star->doWriteTransform(this->star->transform, NULL, true); - desktop->canvas->endForcedFullRedraws(); desktop->getSelection()->set(this->star); if (this->star->hasPathEffectRecursive()) { + this->star->set_shape(); sp_lpe_item_update_patheffect (this->star, true, false); } DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_STAR, -- cgit v1.2.3