summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/effect.cpp1
-rw-r--r--src/live_effects/lpe-bendpath.cpp6
-rw-r--r--src/live_effects/lpe-bendpath.h4
-rw-r--r--src/live_effects/lpe-fill-between-many.cpp7
-rw-r--r--src/live_effects/lpe-fill-between-many.h1
-rw-r--r--src/live_effects/lpe-fill-between-strokes.cpp5
-rw-r--r--src/live_effects/lpe-fill-between-strokes.h1
-rw-r--r--src/object/sp-ellipse.cpp9
-rw-r--r--src/object/sp-item.cpp6
-rw-r--r--src/object/sp-path.cpp16
-rw-r--r--src/object/sp-spiral.cpp9
-rw-r--r--src/object/sp-star.cpp11
12 files changed, 26 insertions, 50 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp
index 46767ac84..396f03e92 100644
--- a/src/live_effects/effect.cpp
+++ b/src/live_effects/effect.cpp
@@ -557,6 +557,7 @@ void Effect::doOnApply_impl(SPLPEItem const* lpeitem)
void Effect::doBeforeEffect_impl(SPLPEItem const* lpeitem)
{
sp_lpe_item = const_cast<SPLPEItem *>(lpeitem);
+ setReady();
doBeforeEffect(lpeitem);
update_helperpath();
}
diff --git a/src/live_effects/lpe-bendpath.cpp b/src/live_effects/lpe-bendpath.cpp
index 6bf555156..6ff40be26 100644
--- a/src/live_effects/lpe-bendpath.cpp
+++ b/src/live_effects/lpe-bendpath.cpp
@@ -165,12 +165,6 @@ LPEBendPath::resetDefaults(SPItem const* item)
}
void
-LPEBendPath::transform_multiply(Geom::Affine const& postmul, bool set)
-{
- //block parameters be transformed because shapes with bend store transform in the element
-}
-
-void
LPEBendPath::addCanvasIndicators(SPLPEItem const */*lpeitem*/, std::vector<Geom::PathVector> &hp_vec)
{
hp_vec.push_back(helper_path);
diff --git a/src/live_effects/lpe-bendpath.h b/src/live_effects/lpe-bendpath.h
index 4909a490a..e8f1b40ca 100644
--- a/src/live_effects/lpe-bendpath.h
+++ b/src/live_effects/lpe-bendpath.h
@@ -44,9 +44,7 @@ public:
void resetDefaults(SPItem const* item) override;
void addCanvasIndicators(SPLPEItem const */*lpeitem*/, std::vector<Geom::PathVector> &hp_vec) override;
-
- void transform_multiply(Geom::Affine const& postmul, bool set) override;
-
+
void addKnotHolderEntities(KnotHolder * knotholder, SPItem * item) override;
PathParam bend_path;
diff --git a/src/live_effects/lpe-fill-between-many.cpp b/src/live_effects/lpe-fill-between-many.cpp
index 886b840e6..223bc631e 100644
--- a/src/live_effects/lpe-fill-between-many.cpp
+++ b/src/live_effects/lpe-fill-between-many.cpp
@@ -35,7 +35,6 @@ LPEFillBetweenMany::LPEFillBetweenMany(LivePathEffectObject *lpeobject) :
linked_paths(_("Linked path:"), _("Paths from which to take the original path data"), "linkedpaths", &wr, this),
method(_("LPE's on linked:"), _("LPE's on linked"), "method", FLMConverter, &wr, this, FLM_BSPLINESPIRO),
fuse(_("Fuse coincident points"), _("Fuse coincident points"), "fuse", &wr, this, false),
- allow_transforms(_("Allow transforms"), _("Allow transforms"), "allow_transforms", &wr, this, false),
join(_("Join subpaths"), _("Join subpaths"), "join", &wr, this, true),
close(_("Close"), _("Close path"), "close", &wr, this, true),
applied("Store the first apply", "", "applied", &wr, this, "false", false)
@@ -43,7 +42,6 @@ LPEFillBetweenMany::LPEFillBetweenMany(LivePathEffectObject *lpeobject) :
registerParameter(&linked_paths);
registerParameter(&method);
registerParameter(&fuse);
- registerParameter(&allow_transforms);
registerParameter(&join);
registerParameter(&close);
registerParameter(&applied);
@@ -76,7 +74,6 @@ void LPEFillBetweenMany::doOnApply (SPLPEItem const* lpeitem)
lpe_repr->setAttribute("linkedpaths", os.str());
lpe_repr->setAttribute("applied", "true");
lpe_repr->setAttribute("method", "partial");
- lpe_repr->setAttribute("allow_transforms", "false");
document->getDefs()->getRepr()->addChild(lpe_repr, nullptr); // adds to <defs> and assigns the 'id' attribute
}
std::string lpe_id_href = std::string("#") + lpe_repr->attribute("id");
@@ -146,10 +143,6 @@ void LPEFillBetweenMany::doEffect (SPCurve * curve)
}
}
- if(!allow_transforms) {
- SP_ITEM(sp_lpe_item)->setAttribute("transform", nullptr);
- }
-
if (!res_pathv.empty() && close) {
res_pathv.front().close();
}
diff --git a/src/live_effects/lpe-fill-between-many.h b/src/live_effects/lpe-fill-between-many.h
index 601dce5c6..1a56b8701 100644
--- a/src/live_effects/lpe-fill-between-many.h
+++ b/src/live_effects/lpe-fill-between-many.h
@@ -35,7 +35,6 @@ private:
OriginalPathArrayParam linked_paths;
EnumParam<Filllpemethod> method;
BoolParam fuse;
- BoolParam allow_transforms;
BoolParam join;
BoolParam close;
HiddenParam applied;
diff --git a/src/live_effects/lpe-fill-between-strokes.cpp b/src/live_effects/lpe-fill-between-strokes.cpp
index 22dfe7e54..68abe52c7 100644
--- a/src/live_effects/lpe-fill-between-strokes.cpp
+++ b/src/live_effects/lpe-fill-between-strokes.cpp
@@ -20,7 +20,6 @@ LPEFillBetweenStrokes::LPEFillBetweenStrokes(LivePathEffectObject *lpeobject) :
second_path(_("Second path:"), _("Second path from which to take the original path data"), "secondpath", &wr, this),
reverse_second(_("Reverse Second"), _("Reverses the second path order"), "reversesecond", &wr, this),
fuse(_("Fuse coincident points"), _("Fuse coincident points"), "fuse", &wr, this, false),
- allow_transforms(_("Allow transforms"), _("Allow transforms"), "allow_transforms", &wr, this, false),
join(_("Join subpaths"), _("Join subpaths"), "join", &wr, this, true),
close(_("Close"), _("Close path"), "close", &wr, this, true)
{
@@ -28,7 +27,6 @@ LPEFillBetweenStrokes::LPEFillBetweenStrokes(LivePathEffectObject *lpeobject) :
registerParameter(&second_path);
registerParameter(&reverse_second);
registerParameter(&fuse);
- registerParameter(&allow_transforms);
registerParameter(&join);
registerParameter(&close);
}
@@ -40,9 +38,6 @@ void LPEFillBetweenStrokes::doEffect (SPCurve * curve)
{
if (curve) {
Geom::Affine affine = Geom::identity();
- if(!allow_transforms) {
- SP_ITEM(sp_lpe_item)->setAttribute("transform", nullptr);
- }
if ( linked_path.linksToPath() && second_path.linksToPath() && linked_path.getObject() && second_path.getObject() ) {
Geom::PathVector linked_pathv = linked_path.get_pathvector();
SPItem * linked1 = linked_path.getObject();
diff --git a/src/live_effects/lpe-fill-between-strokes.h b/src/live_effects/lpe-fill-between-strokes.h
index b3b1da2c6..18ba28fe3 100644
--- a/src/live_effects/lpe-fill-between-strokes.h
+++ b/src/live_effects/lpe-fill-between-strokes.h
@@ -26,7 +26,6 @@ private:
OriginalPathParam second_path;
BoolParam reverse_second;
BoolParam fuse;
- BoolParam allow_transforms;
BoolParam join;
BoolParam close;
diff --git a/src/object/sp-ellipse.cpp b/src/object/sp-ellipse.cpp
index a3ac66838..97bad1fdf 100644
--- a/src/object/sp-ellipse.cpp
+++ b/src/object/sp-ellipse.cpp
@@ -502,16 +502,13 @@ void SPGenericEllipse::set_shape()
Geom::Affine SPGenericEllipse::set_transform(Geom::Affine const &xform)
{
+ // TODO: try to remove CLONE_ORIGINAL from here
if (hasPathEffect() && pathEffectsEnabled() &&
- (this->hasPathEffectOfType(Inkscape::LivePathEffect::CLONE_ORIGINAL) ||
- this->hasPathEffectOfType(Inkscape::LivePathEffect::BEND_PATH) ||
- this->hasPathEffectOfType(Inkscape::LivePathEffect::POWERCLIP) ||
- this->hasPathEffectOfType(Inkscape::LivePathEffect::FILL_BETWEEN_MANY) ||
- this->hasPathEffectOfType(Inkscape::LivePathEffect::FILL_BETWEEN_STROKES) ) )
+ this->hasPathEffectOfType(Inkscape::LivePathEffect::CLONE_ORIGINAL ))
{
// 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->adjust_livepatheffect(xform.inverse());
return xform;
}
/* Calculate ellipse start in parent coords. */
diff --git a/src/object/sp-item.cpp b/src/object/sp-item.cpp
index 4b5858f7e..b7cd69c7f 100644
--- a/src/object/sp-item.cpp
+++ b/src/object/sp-item.cpp
@@ -1513,12 +1513,14 @@ void SPItem::doWriteTransform(Geom::Affine const &transform, Geom::Affine const
)
{
transform_attr = this->set_transform(transform);
+ if (lpeitem && lpeitem->hasPathEffectRecursive()) {
+ lpeitem->adjust_livepatheffect(transform_attr);
+ }
if (freeze_stroke_width) {
freeze_stroke_width_recursive(false);
}
-
} else {
- if (lpeitem && lpeitem->hasPathEffectRecursive()) {
+ if (!preserve && lpeitem && lpeitem->hasPathEffectRecursive()) {
lpeitem->adjust_livepatheffect(transform_attr);
}
if (freeze_stroke_width) {
diff --git a/src/object/sp-path.cpp b/src/object/sp-path.cpp
index cf8c0ad10..d951d1738 100644
--- a/src/object/sp-path.cpp
+++ b/src/object/sp-path.cpp
@@ -326,17 +326,21 @@ Geom::Affine SPPath::set_transform(Geom::Affine const &transform) {
if (!_curve) { // 0 nodes, nothing to transform
return Geom::identity();
}
+ // Only set transform with proportional scaling
+ if (!transform.withoutTranslation().isUniformScale()) {
+ // Adjust livepatheffect
+ if (hasPathEffect() && pathEffectsEnabled()) {
+ this->adjust_livepatheffect(transform.inverse());
+ return transform;
+ }
+ }
+ // TODO: try to remove CLONE_ORIGINAL from here
// Transform the original-d path if this is a valid LPE this, other else the (ordinary) path
if (_curve_before_lpe && hasPathEffectRecursive()) {
- if (this->hasPathEffectOfType(Inkscape::LivePathEffect::CLONE_ORIGINAL) ||
- this->hasPathEffectOfType(Inkscape::LivePathEffect::BEND_PATH) ||
- this->hasPathEffectOfType(Inkscape::LivePathEffect::POWERCLIP) ||
- this->hasPathEffectOfType(Inkscape::LivePathEffect::FILL_BETWEEN_MANY) ||
- this->hasPathEffectOfType(Inkscape::LivePathEffect::FILL_BETWEEN_STROKES) )
+ if (this->hasPathEffectOfType(Inkscape::LivePathEffect::CLONE_ORIGINAL))
{
// 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(transform);
return transform;
} else {
_curve_before_lpe->transform(transform);
diff --git a/src/object/sp-spiral.cpp b/src/object/sp-spiral.cpp
index ba4cc0ce5..a34e7c6d8 100644
--- a/src/object/sp-spiral.cpp
+++ b/src/object/sp-spiral.cpp
@@ -408,16 +408,13 @@ void SPSpiral::snappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape
*/
Geom::Affine SPSpiral::set_transform(Geom::Affine const &xform)
{
+ // TODO: try to remove CLONE_ORIGINAL from here
if (hasPathEffect() && pathEffectsEnabled() &&
- (this->hasPathEffectOfType(Inkscape::LivePathEffect::CLONE_ORIGINAL) ||
- this->hasPathEffectOfType(Inkscape::LivePathEffect::BEND_PATH) ||
- this->hasPathEffectOfType(Inkscape::LivePathEffect::POWERCLIP) ||
- this->hasPathEffectOfType(Inkscape::LivePathEffect::FILL_BETWEEN_MANY) ||
- this->hasPathEffectOfType(Inkscape::LivePathEffect::FILL_BETWEEN_STROKES) ) )
+ this->hasPathEffectOfType(Inkscape::LivePathEffect::CLONE_ORIGINAL) )
{
// 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->adjust_livepatheffect(xform.inverse());
return xform;
}
// Only set transform with proportional scaling
diff --git a/src/object/sp-star.cpp b/src/object/sp-star.cpp
index 40d38d4a8..a960d2018 100644
--- a/src/object/sp-star.cpp
+++ b/src/object/sp-star.cpp
@@ -494,23 +494,20 @@ void SPStar::snappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::
Geom::Affine SPStar::set_transform(Geom::Affine const &xform)
{
bool opt_trans = (randomized == 0);
+ // TODO: try to remove CLONE_ORIGINAL from here
if (hasPathEffect() && pathEffectsEnabled() &&
- (this->hasPathEffectOfType(Inkscape::LivePathEffect::CLONE_ORIGINAL) ||
- this->hasPathEffectOfType(Inkscape::LivePathEffect::BEND_PATH) ||
- this->hasPathEffectOfType(Inkscape::LivePathEffect::POWERCLIP) ||
- this->hasPathEffectOfType(Inkscape::LivePathEffect::FILL_BETWEEN_MANY) ||
- this->hasPathEffectOfType(Inkscape::LivePathEffect::FILL_BETWEEN_STROKES) ) )
+ this->hasPathEffectOfType(Inkscape::LivePathEffect::CLONE_ORIGINAL))
{
// 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->adjust_livepatheffect(xform.inverse());
return xform;
}
// Only set transform with proportional scaling
if (!xform.withoutTranslation().isUniformScale()) {
// Adjust livepatheffect
if (hasPathEffect() && pathEffectsEnabled()) {
- this->adjust_livepatheffect(xform);
+ this->adjust_livepatheffect(xform.inverse());
}
return xform;
}