From f318dbfe434769ab62b4f9d2971de89f1ebffc71 Mon Sep 17 00:00:00 2001 From: Jabiertxo Arraiza Cenoz Date: Mon, 9 Oct 2017 20:33:01 +0200 Subject: Fixes for transforms in LPE shapes --- src/sp-spiral.cpp | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'src/sp-spiral.cpp') diff --git a/src/sp-spiral.cpp b/src/sp-spiral.cpp index f59fc0720..f35d5e86b 100644 --- a/src/sp-spiral.cpp +++ b/src/sp-spiral.cpp @@ -14,7 +14,7 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ - +#include "live_effects/effect.h" #include "svg/svg.h" #include "attributes.h" #include <2geom/bezier-utils.h> @@ -429,17 +429,27 @@ void SPSpiral::snappoints(std::vector &p, Inkscape */ Geom::Affine SPSpiral::set_transform(Geom::Affine const &xform) { - // Only set transform with proportional scaling - if (!xform.withoutTranslation().isUniformScale()) { - return xform; - } - - // Allow live effects - if (hasPathEffect() && pathEffectsEnabled()) { + if (hasPathEffect() && pathEffectsEnabled() && + (this->hasPathEffectOfType(Inkscape::LivePathEffect::CLONE_ORIGINAL) || + this->hasPathEffectOfType(Inkscape::LivePathEffect::BEND_PATH) || + this->hasPathEffectOfType(Inkscape::LivePathEffect::FILL_BETWEEN_MANY) || + this->hasPathEffectOfType(Inkscape::LivePathEffect::FILL_BETWEEN_STROKES) ) ) + { + // if path has this LPE applied, don't write the transform to the pathdata, but write it 'unoptimized' + // also if the effect is type BEND PATH to fix bug #179842 this->adjust_livepatheffect(xform); this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); return xform; } + // Only set transform with proportional scaling + if (!xform.withoutTranslation().isUniformScale()) { + // Adjust livepatheffect + if (hasPathEffect() && pathEffectsEnabled()) { + this->adjust_livepatheffect(xform); + this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); + } + return xform; + } /* Calculate spiral start in parent coords. */ Geom::Point pos( Geom::Point(this->cx, this->cy) * xform ); @@ -478,6 +488,9 @@ Geom::Affine SPSpiral::set_transform(Geom::Affine const &xform) // Adjust gradient fill this->adjust_gradient(xform * ret.inverse()); + // Adjust livepatheffect + this->adjust_livepatheffect(xform); + this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); return ret; -- cgit v1.2.3