summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2018-12-15 18:45:32 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2018-12-15 18:45:32 +0000
commite3dece3d90d745cd3b952be8247092dc1e4c6570 (patch)
treeccfd27a9135b40dfdf1740f5579c4c937c0534cd /src
parentRound-trip SVG 2 flowed text with SVG 1.1 backup. (diff)
downloadinkscape-e3dece3d90d745cd3b952be8247092dc1e4c6570.tar.gz
inkscape-e3dece3d90d745cd3b952be8247092dc1e4c6570.zip
Remove unused transform functions related to LPE and improvements to fill-betreen-* LPEs
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/effect.cpp11
-rw-r--r--src/live_effects/effect.h10
-rw-r--r--src/live_effects/lpe-copy_rotate.cpp12
-rw-r--r--src/live_effects/lpe-copy_rotate.h1
-rw-r--r--src/live_effects/lpe-curvestitch.cpp18
-rw-r--r--src/live_effects/lpe-curvestitch.h2
-rw-r--r--src/live_effects/lpe-embrodery-stitch.cpp11
-rw-r--r--src/live_effects/lpe-embrodery-stitch.h2
-rw-r--r--src/live_effects/lpe-fill-between-many.cpp210
-rw-r--r--src/live_effects/lpe-fill-between-many.h4
-rw-r--r--src/live_effects/lpe-fill-between-strokes.cpp37
-rw-r--r--src/live_effects/lpe-mirror_symmetry.cpp11
-rw-r--r--src/live_effects/lpe-mirror_symmetry.h1
-rw-r--r--src/live_effects/lpe-patternalongpath.cpp19
-rw-r--r--src/live_effects/lpe-patternalongpath.h2
-rw-r--r--src/object/box3d.cpp3
-rw-r--r--src/object/sp-item.cpp20
-rw-r--r--src/object/sp-item.h2
-rw-r--r--src/object/sp-path.cpp15
-rw-r--r--src/splivarot.cpp1
20 files changed, 159 insertions, 233 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp
index a54f9007d..1ba94a2a2 100644
--- a/src/live_effects/effect.cpp
+++ b/src/live_effects/effect.cpp
@@ -1002,17 +1002,6 @@ Effect::resetDefaults(SPItem const* /*item*/)
}
}
-//Activate handle your transform filling your effect on SPPath.cpp
-void
-Effect::transform_multiply(Geom::Affine const& postmul, bool set)
-{
- // cycle through all parameters. Most parameters will not need transformation, but path and point params do.
- for (std::vector<Parameter *>::iterator it = param_vector.begin(); it != param_vector.end(); ++it) {
- Parameter * param = *it;
- param->param_transform_multiply(postmul, set);
- }
-}
-
bool
Effect::providesKnotholder() const
{
diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h
index ae0913f2c..d21240b72 100644
--- a/src/live_effects/effect.h
+++ b/src/live_effects/effect.h
@@ -102,9 +102,6 @@ public:
*/
virtual void resetDefaults(SPItem const* item);
- /// /todo: is this method really necessary? it causes UI inconsistensies... (johan)
- virtual void transform_multiply(Geom::Affine const& postmul, bool set);
-
// /TODO: providesKnotholder() is currently used as an indicator of whether a nodepath is
// created for an item or not. When we allow both at the same time, this needs rethinking!
bool providesKnotholder() const;
@@ -140,7 +137,10 @@ public:
BoolParam is_visible;
Geom::PathVector pathvector_before_effect;
Geom::PathVector pathvector_after_effect;
-protected:
+ SPLPEItem *sp_lpe_item; // these get stored in doBeforeEffect_impl, and derived classes may do as they please with
+ // them.
+ SPShape *current_shape; // these get stored in performPathEffects.
+ protected:
Effect(LivePathEffectObject *lpeobject);
// provide a set of doEffect functions so the developer has a choice
@@ -175,8 +175,6 @@ protected:
// this boolean defaults to false, it concatenates the input path to one pwd2,
// instead of normally 'splitting' the path into continuous pwd2 paths and calling doEffect_pwd2 for each.
bool concatenate_before_pwd2;
- SPLPEItem * sp_lpe_item; // these get stored in doBeforeEffect_impl, and derived classes may do as they please with them.
- SPShape * current_shape; // these get stored in performPathEffects.
std::vector<Glib::ustring> items;
double current_zoom;
std::vector<Geom::Point> selectedNodesPoints;
diff --git a/src/live_effects/lpe-copy_rotate.cpp b/src/live_effects/lpe-copy_rotate.cpp
index 8a318dfc2..1dda91e6f 100644
--- a/src/live_effects/lpe-copy_rotate.cpp
+++ b/src/live_effects/lpe-copy_rotate.cpp
@@ -366,18 +366,6 @@ LPECopyRotate::doOnApply(SPLPEItem const* lpeitem)
}
void
-LPECopyRotate::transform_multiply(Geom::Affine const& postmul, bool set)
-{
- // cycle through all parameters. Most parameters will not need transformation, but path and point params do.
- for (std::vector<Parameter *>::iterator it = param_vector.begin(); it != param_vector.end(); ++it) {
- Parameter * param = *it;
- if(param->param_key != "starting_point" || postmul.isRotation()) {
- param->param_transform_multiply(postmul, set);
- }
- }
-}
-
-void
LPECopyRotate::doBeforeEffect (SPLPEItem const* lpeitem)
{
using namespace Geom;
diff --git a/src/live_effects/lpe-copy_rotate.h b/src/live_effects/lpe-copy_rotate.h
index e742f547d..188d79f37 100644
--- a/src/live_effects/lpe-copy_rotate.h
+++ b/src/live_effects/lpe-copy_rotate.h
@@ -42,7 +42,6 @@ public:
void doAfterEffect (SPLPEItem const* lpeitem) override;
void split(Geom::PathVector &path_in, Geom::Path const &divider);
void resetDefaults(SPItem const* item) override;
- void transform_multiply(Geom::Affine const& postmul, bool set) override;
void doOnRemove (SPLPEItem const* /*lpeitem*/) override;
void doOnVisibilityToggled(SPLPEItem const* /*lpeitem*/) override;
Gtk::Widget * newWidget() override;
diff --git a/src/live_effects/lpe-curvestitch.cpp b/src/live_effects/lpe-curvestitch.cpp
index 0d0e37392..254065da8 100644
--- a/src/live_effects/lpe-curvestitch.cpp
+++ b/src/live_effects/lpe-curvestitch.cpp
@@ -183,24 +183,6 @@ LPECurveStitch::resetDefaults(SPItem const* item)
}
}
-
-/** /todo check whether this special case is necessary. It seems to "bug" editing behavior:
- * scaling an object with transforms preserved behaves differently from scaling with
- * transforms optimized (difference caused by this special method).
- * special casing is probably needed, because rotation should not be propagated to the strokepath.
- */
-void
-LPECurveStitch::transform_multiply(Geom::Affine const& postmul, bool set)
-{
- // only take translations into account
- if (postmul.isTranslation()) {
- strokepath.param_transform_multiply(postmul, set);
- } else if (!scale_y_rel.get_value()) {
- transformed = true;
- strokepath.param_transform_multiply(postmul, set);
- }
-}
-
} //namespace LivePathEffect
} /* namespace Inkscape */
diff --git a/src/live_effects/lpe-curvestitch.h b/src/live_effects/lpe-curvestitch.h
index ad40a08fa..7faef725b 100644
--- a/src/live_effects/lpe-curvestitch.h
+++ b/src/live_effects/lpe-curvestitch.h
@@ -33,8 +33,6 @@ public:
void resetDefaults(SPItem const* item) override;
- void transform_multiply(Geom::Affine const& postmul, bool set) override;
-
private:
PathParam strokepath;
ScalarParam nrofpaths;
diff --git a/src/live_effects/lpe-embrodery-stitch.cpp b/src/live_effects/lpe-embrodery-stitch.cpp
index 6a0818db6..a0350fec5 100644
--- a/src/live_effects/lpe-embrodery-stitch.cpp
+++ b/src/live_effects/lpe-embrodery-stitch.cpp
@@ -384,16 +384,5 @@ LPEEmbroderyStitch::resetDefaults(SPItem const *item)
Effect::resetDefaults(item);
}
-
-/** /todo check whether this special case is necessary. It seems to "bug" editing behavior:
- * scaling an object with transforms preserved behaves differently from scaling with
- * transforms optimized (difference caused by this special method).
- * special casing is probably needed, because rotation should not be propagated to the strokepath.
- */
-void
-LPEEmbroderyStitch::transform_multiply(Affine const &postmul, bool set)
-{
-}
-
} //namespace LivePathEffect
} /* namespace Inkscape */
diff --git a/src/live_effects/lpe-embrodery-stitch.h b/src/live_effects/lpe-embrodery-stitch.h
index 47403b26c..6bbd931a5 100644
--- a/src/live_effects/lpe-embrodery-stitch.h
+++ b/src/live_effects/lpe-embrodery-stitch.h
@@ -31,8 +31,6 @@ public:
void resetDefaults(SPItem const *item) override;
- void transform_multiply(Geom::Affine const &postmul, bool set) override;
-
enum order_method {
order_method_no_reorder,
order_method_zigzag,
diff --git a/src/live_effects/lpe-fill-between-many.cpp b/src/live_effects/lpe-fill-between-many.cpp
index 4f1ae553b..6eb5750f0 100644
--- a/src/live_effects/lpe-fill-between-many.cpp
+++ b/src/live_effects/lpe-fill-between-many.cpp
@@ -15,7 +15,6 @@
#include "object/sp-defs.h"
#include "object/sp-shape.h"
-
#include "svg/svg.h"
// TODO due to internal breakage in glibmm headers, this must be last:
@@ -31,20 +30,22 @@ static const Util::EnumData<Filllpemethod> FilllpemethodData[] = {
};
static const Util::EnumDataConverter<Filllpemethod> FLMConverter(FilllpemethodData, FLM_END);
-LPEFillBetweenMany::LPEFillBetweenMany(LivePathEffectObject *lpeobject) :
- Effect(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),
- 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)
+LPEFillBetweenMany::LPEFillBetweenMany(LivePathEffectObject *lpeobject)
+ : Effect(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)
+ , join(_("Join subpaths"), _("Join subpaths"), "join", &wr, this, true)
+ , close(_("Close"), _("Close path"), "close", &wr, this, true)
+ , autoreverse(_("Autoreverse"), _("Autoreverse"), "autoreverse", &wr, this, true)
+ , applied("Store the first apply", "", "applied", &wr, this, "false", false)
{
registerParameter(&linked_paths);
registerParameter(&method);
registerParameter(&fuse);
registerParameter(&join);
registerParameter(&close);
+ registerParameter(&autoreverse);
registerParameter(&applied);
previous_method = FLM_END;
}
@@ -52,53 +53,6 @@ LPEFillBetweenMany::LPEFillBetweenMany(LivePathEffectObject *lpeobject) :
LPEFillBetweenMany::~LPEFillBetweenMany()
= default;
-void LPEFillBetweenMany::doOnApply (SPLPEItem const* lpeitem)
-{
- SPDocument * document = SP_ACTIVE_DOCUMENT;
- if (!document) {
- return;
- }
- SPLPEItem *lpe_item = const_cast<SPLPEItem *>(lpeitem);
- SPObject * parent = lpe_item->parent;
- if (lpe_item) {
- SPShape *shape = dynamic_cast<SPShape *>(lpe_item);
- if (shape) {
- Inkscape::SVGOStringStream os;
- if (strcmp(this->lpeobj->getRepr()->attribute("applied"), "false") == 0) {
- os << '#' << SP_ITEM(lpe_item)->getId() << ",0,1";
-
- Inkscape::XML::Document *xml_doc = document->getReprDoc();
- // create the LPE
- Inkscape::XML::Node *lpe_repr = xml_doc->createElement("inkscape:path-effect");
- {
- lpe_repr->setAttribute("effect", "fill_between_many");
- lpe_repr->setAttribute("linkedpaths", os.str());
- lpe_repr->setAttribute("applied", "true");
- lpe_repr->setAttribute("method", "partial");
- 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");
- Inkscape::GC::release(lpe_repr);
- Inkscape::XML::Node *clone = xml_doc->createElement("svg:path");
- {
- clone->setAttribute("d", "M 0 0", false);
- // add the new clone to the top of the original's parent
- parent->appendChildRepr(clone);
- SPObject *clone_obj = document->getObjectById(clone->attribute("id"));
- SPLPEItem *clone_lpeitem = dynamic_cast<SPLPEItem *>(clone_obj);
- if (clone_lpeitem) {
- clone_lpeitem->addPathEffect(lpe_id_href, false);
- }
- }
- Inkscape::Selection * sel = SP_ACTIVE_DESKTOP->getSelection();
- sel->set(clone);
- Inkscape::GC::release(clone);
- lpe_item->removeCurrentPathEffect(false);
- }
- }
- }
-}
-
void LPEFillBetweenMany::doEffect (SPCurve * curve)
{
if (previous_method != method) {
@@ -115,39 +69,135 @@ void LPEFillBetweenMany::doEffect (SPCurve * curve)
previous_method = method;
}
Geom::PathVector res_pathv;
- for (std::vector<PathAndDirectionAndVisible*>::iterator iter = linked_paths._vector.begin(); iter != linked_paths._vector.end(); ++iter) {
- SPObject *obj;
- if ((*iter)->ref.isAttached() && (obj = (*iter)->ref.getObject()) && SP_IS_ITEM(obj) && !(*iter)->_pathvector.empty() && (*iter)->visibled) {
- Geom::Path linked_path;
- if ((*iter)->reversed) {
- linked_path = (*iter)->_pathvector.front().reversed();
- } else {
- linked_path = (*iter)->_pathvector.front();
- }
- if (obj) {
- linked_path *= SP_ITEM(obj)->transform;
- }
-
- if (!res_pathv.empty() && join) {
- if (!are_near(res_pathv.front().finalPoint(), linked_path.initialPoint(), 0.01) || !fuse) {
- res_pathv.front().appendNew<Geom::LineSegment>(linked_path.initialPoint());
+ Geom::Affine transf = sp_item_transform_repr(sp_lpe_item);
+ if (transf != Geom::identity()) {
+ sp_lpe_item->doWriteTransform(Geom::identity());
+ }
+ bool closedlink = false;
+ SPDesktop *desktop = SP_ACTIVE_DESKTOP;
+ Inkscape::Selection *selection = nullptr;
+ if (desktop) {
+ selection = desktop->selection;
+ }
+ if (!autoreverse) {
+ for (std::vector<PathAndDirectionAndVisible *>::iterator iter = linked_paths._vector.begin();
+ iter != linked_paths._vector.end(); ++iter) {
+ SPObject *obj;
+ if ((*iter)->ref.isAttached() && (obj = (*iter)->ref.getObject()) && SP_IS_ITEM(obj) &&
+ !(*iter)->_pathvector.empty() && (*iter)->visibled) {
+ Geom::Path linked_path;
+ if ((*iter)->_pathvector.front().closed() && linked_paths._vector.size() > 1) {
+ continue;
+ }
+ if (obj && transf != Geom::identity() && selection && !selection->includes(obj->getRepr())) {
+ SP_ITEM(obj)->doWriteTransform(transf);
+ }
+ if ((*iter)->reversed) {
+ linked_path = (*iter)->_pathvector.front().reversed();
+ } else {
+ linked_path = (*iter)->_pathvector.front();
+ }
+ if (!res_pathv.empty() && join) {
+ if (!are_near(res_pathv.front().finalPoint(), linked_path.initialPoint(), 0.01) || !fuse) {
+ res_pathv.front().appendNew<Geom::LineSegment>(linked_path.initialPoint());
+ } else {
+ linked_path.setInitial(res_pathv.front().finalPoint());
+ }
+ res_pathv.front().append(linked_path);
} else {
- linked_path.setInitial(res_pathv.front().finalPoint());
+ if (close && !join) {
+ linked_path.close();
+ }
+ res_pathv.push_back(linked_path);
+ }
+ }
+ }
+ } else {
+ unsigned int counter = 0;
+ Geom::Point current = Geom::Point();
+ std::vector<unsigned int> done;
+ for (std::vector<PathAndDirectionAndVisible *>::iterator iter = linked_paths._vector.begin();
+ iter != linked_paths._vector.end(); ++iter) {
+ SPObject *obj;
+ if ((*iter)->ref.isAttached() && (obj = (*iter)->ref.getObject()) && SP_IS_ITEM(obj) &&
+ !(*iter)->_pathvector.empty() && (*iter)->visibled) {
+ Geom::Path linked_path;
+ if ((*iter)->_pathvector.front().closed() && linked_paths._vector.size() > 1) {
+ counter++;
+ continue;
+ }
+ if (obj && transf != Geom::identity() && selection && !selection->includes(obj->getRepr())) {
+ SP_ITEM(obj)->doWriteTransform(transf);
+ }
+ if (counter == 0) {
+ current = (*iter)->_pathvector.front().finalPoint();
+ Geom::Path initial_path = (*iter)->_pathvector.front();
+ done.push_back(0);
+ if (close && !join) {
+ initial_path.close();
+ }
+ res_pathv.push_back(initial_path);
}
- res_pathv.front().append(linked_path);
- } else {
- if (close && !join) {
- linked_path.close();
+ Geom::Coord distance = Geom::infinity();
+ unsigned int counter2 = 0;
+ unsigned int added = 0;
+ PathAndDirectionAndVisible *nearest = nullptr;
+ for (std::vector<PathAndDirectionAndVisible *>::iterator iter2 = linked_paths._vector.begin();
+ iter2 != linked_paths._vector.end(); ++iter2) {
+ SPObject *obj2;
+ if ((*iter2)->ref.isAttached() && (obj2 = (*iter2)->ref.getObject()) && SP_IS_ITEM(obj2) &&
+ !(*iter2)->_pathvector.empty() && (*iter2)->visibled) {
+ if (obj == obj2 || std::find(done.begin(), done.end(), counter2) != done.end()) {
+ counter2++;
+ continue;
+ }
+ if ((*iter2)->_pathvector.front().closed() && linked_paths._vector.size() > 1) {
+ counter2++;
+ continue;
+ }
+ Geom::Point start = (*iter2)->_pathvector.front().initialPoint();
+ Geom::Point end = (*iter2)->_pathvector.front().finalPoint();
+ Geom::Coord distance_iter =
+ std::min(Geom::distance(current, end), Geom::distance(current, start));
+ if (distance > distance_iter) {
+ distance = distance_iter;
+ nearest = (*iter2);
+ added = counter2;
+ }
+ counter2++;
+ }
+ }
+ if (nearest != nullptr) {
+ done.push_back(added);
+ Geom::Point start = nearest->_pathvector.front().initialPoint();
+ Geom::Point end = nearest->_pathvector.front().finalPoint();
+ if (Geom::distance(current, end) > Geom::distance(current, start)) {
+ linked_path = nearest->_pathvector.front();
+ } else {
+ linked_path = nearest->_pathvector.front().reversed();
+ }
+ current = end;
+ if (!res_pathv.empty() && join) {
+ if (!are_near(res_pathv.front().finalPoint(), linked_path.initialPoint(), 0.01) || !fuse) {
+ res_pathv.front().appendNew<Geom::LineSegment>(linked_path.initialPoint());
+ } else {
+ linked_path.setInitial(res_pathv.front().finalPoint());
+ }
+ res_pathv.front().append(linked_path);
+ } else {
+ if (close && !join) {
+ linked_path.close();
+ }
+ res_pathv.push_back(linked_path);
+ }
}
- res_pathv.push_back(linked_path);
+ counter++;
}
}
}
-
if (!res_pathv.empty() && close) {
res_pathv.front().close();
}
-
if (res_pathv.empty()) {
res_pathv = curve->get_pathvector();
}
diff --git a/src/live_effects/lpe-fill-between-many.h b/src/live_effects/lpe-fill-between-many.h
index 833fb45da..cfcdb3228 100644
--- a/src/live_effects/lpe-fill-between-many.h
+++ b/src/live_effects/lpe-fill-between-many.h
@@ -29,18 +29,16 @@ class LPEFillBetweenMany : public Effect {
public:
LPEFillBetweenMany(LivePathEffectObject *lpeobject);
~LPEFillBetweenMany() override;
- void doOnApply (SPLPEItem const* lpeitem) override;
void doEffect (SPCurve * curve) override;
-
private:
OriginalPathArrayParam linked_paths;
EnumParam<Filllpemethod> method;
BoolParam fuse;
BoolParam join;
BoolParam close;
+ BoolParam autoreverse;
HiddenParam applied;
Filllpemethod previous_method;
-private:
LPEFillBetweenMany(const LPEFillBetweenMany&) = delete;
LPEFillBetweenMany& operator=(const LPEFillBetweenMany&) = delete;
};
diff --git a/src/live_effects/lpe-fill-between-strokes.cpp b/src/live_effects/lpe-fill-between-strokes.cpp
index 3a59f6858..3b00b2d03 100644
--- a/src/live_effects/lpe-fill-between-strokes.cpp
+++ b/src/live_effects/lpe-fill-between-strokes.cpp
@@ -38,18 +38,26 @@ LPEFillBetweenStrokes::~LPEFillBetweenStrokes()
void LPEFillBetweenStrokes::doEffect (SPCurve * curve)
{
if (curve) {
- Geom::Affine affine = Geom::identity();
+ SPDesktop *desktop = SP_ACTIVE_DESKTOP;
+ Inkscape::Selection *selection = nullptr;
+ if (desktop) {
+ selection = desktop->selection;
+ }
+ Geom::Affine transf = sp_item_transform_repr(sp_lpe_item);
+ if (transf != Geom::identity()) {
+ sp_lpe_item->doWriteTransform(Geom::identity());
+ }
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();
- if (linked1) {
- linked_pathv *= linked1->transform;
+ if (linked1 && transf != Geom::identity() && selection && !selection->includes(linked1->getRepr())) {
+ SP_ITEM(linked1)->doWriteTransform(transf);
}
- Geom::PathVector second_pathv = second_path.get_pathvector();
+ Geom::PathVector linked_pathv = linked_path.get_pathvector();
SPItem * linked2 = second_path.getObject();
- if (linked2) {
- second_pathv*= linked2->transform;
+ if (linked2 && transf != Geom::identity() && selection && !selection->includes(linked2->getRepr())) {
+ SP_ITEM(linked2)->doWriteTransform(transf);
}
+ Geom::PathVector second_pathv = second_path.get_pathvector();
Geom::PathVector result_linked_pathv;
Geom::PathVector result_second_pathv;
for (Geom::PathVector::iterator iter = linked_pathv.begin(); iter != linked_pathv.end(); ++iter)
@@ -82,26 +90,25 @@ void LPEFillBetweenStrokes::doEffect (SPCurve * curve)
}
result_linked_pathv.push_back(result_second_pathv.front());
}
- result_linked_pathv *= affine.inverse();
curve->set_pathvector(result_linked_pathv);
} else if ( !result_linked_pathv.empty() ) {
- result_linked_pathv *= affine.inverse();
curve->set_pathvector(result_linked_pathv);
} else if ( !result_second_pathv.empty() ) {
- result_second_pathv *= affine.inverse();
curve->set_pathvector(result_second_pathv);
}
}
else if ( linked_path.linksToPath() && linked_path.getObject() ) {
+ SPItem *linked1 = linked_path.getObject();
+ if (linked1 && transf != Geom::identity() && selection && !selection->includes(linked1->getRepr())) {
+ SP_ITEM(linked1)->doWriteTransform(transf);
+ }
Geom::PathVector linked_pathv = linked_path.get_pathvector();
Geom::PathVector result_pathv;
-
for (Geom::PathVector::iterator iter = linked_pathv.begin(); iter != linked_pathv.end(); ++iter)
{
result_pathv.push_back((*iter));
}
if ( !result_pathv.empty() ) {
- result_pathv *= affine.inverse();
if (close) {
result_pathv.front().close();
}
@@ -109,15 +116,17 @@ void LPEFillBetweenStrokes::doEffect (SPCurve * curve)
}
}
else if ( second_path.linksToPath() && second_path.getObject() ) {
+ SPItem *linked2 = second_path.getObject();
+ if (linked2 && transf != Geom::identity() && selection && !selection->includes(linked2->getRepr())) {
+ SP_ITEM(linked2)->doWriteTransform(transf);
+ }
Geom::PathVector second_pathv = second_path.get_pathvector();
Geom::PathVector result_pathv;
-
for (Geom::PathVector::iterator iter = second_pathv.begin(); iter != second_pathv.end(); ++iter)
{
result_pathv.push_back((*iter));
}
if ( !result_pathv.empty() ) {
- result_pathv *= affine.inverse();
if (close) {
result_pathv.front().close();
}
diff --git a/src/live_effects/lpe-mirror_symmetry.cpp b/src/live_effects/lpe-mirror_symmetry.cpp
index 0635a271f..399f1de97 100644
--- a/src/live_effects/lpe-mirror_symmetry.cpp
+++ b/src/live_effects/lpe-mirror_symmetry.cpp
@@ -401,17 +401,6 @@ LPEMirrorSymmetry::doOnRemove (SPLPEItem const* /*lpeitem*/)
}
void
-LPEMirrorSymmetry::transform_multiply(Geom::Affine const& postmul, bool set)
-{
- // cycle through all parameters. Most parameters will not need transformation, but path and point params do.
- for (std::vector<Parameter *>::iterator it = param_vector.begin(); it != param_vector.end(); ++it) {
- Parameter * param = *it;
- param->param_transform_multiply(postmul, set);
- }
- previous_center = Geom::middle_point((Geom::Point)start_point, (Geom::Point)end_point);
-}
-
-void
LPEMirrorSymmetry::doOnApply (SPLPEItem const* lpeitem)
{
using namespace Geom;
diff --git a/src/live_effects/lpe-mirror_symmetry.h b/src/live_effects/lpe-mirror_symmetry.h
index 875602c05..55c6245f6 100644
--- a/src/live_effects/lpe-mirror_symmetry.h
+++ b/src/live_effects/lpe-mirror_symmetry.h
@@ -45,7 +45,6 @@ public:
void doOnApply (SPLPEItem const* lpeitem) override;
void doBeforeEffect (SPLPEItem const* lpeitem) override;
void doAfterEffect (SPLPEItem const* lpeitem) override;
- void transform_multiply(Geom::Affine const& postmul, bool set) override;
Geom::PathVector doEffect_path (Geom::PathVector const & path_in) override;
void doOnRemove (SPLPEItem const* /*lpeitem*/) override;
void doOnVisibilityToggled(SPLPEItem const* /*lpeitem*/) override;
diff --git a/src/live_effects/lpe-patternalongpath.cpp b/src/live_effects/lpe-patternalongpath.cpp
index a89dd6bba..57a3c3875 100644
--- a/src/live_effects/lpe-patternalongpath.cpp
+++ b/src/live_effects/lpe-patternalongpath.cpp
@@ -268,25 +268,6 @@ LPEPatternAlongPath::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > con
}
void
-LPEPatternAlongPath::transform_multiply(Geom::Affine const& postmul, bool set)
-{
- // overriding the Effect class default method, disabling transform forwarding to the parameters.
-
- // only take translations into account
- // Check if proportional stroke-width scaling is on
- Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- bool transform_stroke = prefs ? prefs->getBool("/options/transform/stroke", true) : true;
- if (transform_stroke && !scale_y_rel) {
- prop_scale.param_set_value(prop_scale * ((postmul.expansionX() + postmul.expansionY()) / 2));
- prop_scale.write_to_SVG();
- }
- if (postmul.isTranslation()) {
- pattern.param_transform_multiply(postmul, set);
- pattern.write_to_SVG();
- }
-}
-
-void
LPEPatternAlongPath::addCanvasIndicators(SPLPEItem const */*lpeitem*/, std::vector<Geom::PathVector> &hp_vec)
{
hp_vec.push_back(helper_path);
diff --git a/src/live_effects/lpe-patternalongpath.h b/src/live_effects/lpe-patternalongpath.h
index a5831afa0..7e12561f0 100644
--- a/src/live_effects/lpe-patternalongpath.h
+++ b/src/live_effects/lpe-patternalongpath.h
@@ -40,8 +40,6 @@ public:
Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in) override;
- void transform_multiply(Geom::Affine const& postmul, bool set) override;
-
void addCanvasIndicators(SPLPEItem const */*lpeitem*/, std::vector<Geom::PathVector> &hp_vec) override;
void addKnotHolderEntities(KnotHolder * knotholder, SPItem * item) override;
diff --git a/src/object/box3d.cpp b/src/object/box3d.cpp
index 4416a0474..2de71f686 100644
--- a/src/object/box3d.cpp
+++ b/src/object/box3d.cpp
@@ -281,9 +281,6 @@ Geom::Affine SPBox3D::set_transform(Geom::Affine const &xform) {
// Adjust gradient fill
childitem->adjust_gradient(xform);
-
- // Adjust LPE
- childitem->adjust_livepatheffect(xform);
}
}
diff --git a/src/object/sp-item.cpp b/src/object/sp-item.cpp
index edf216481..cbfd126f9 100644
--- a/src/object/sp-item.cpp
+++ b/src/object/sp-item.cpp
@@ -1411,26 +1411,6 @@ void SPItem::adjust_paint_recursive (Geom::Affine advertized_transform, Geom::Af
}
}
-void SPItem::adjust_livepatheffect (Geom::Affine const &postmul, bool set)
-{
- SPLPEItem *lpeitem = dynamic_cast<SPLPEItem *>(this);
- if ( lpeitem && lpeitem->hasPathEffect() ) {
- lpeitem->forkPathEffectsIfNecessary();
- // now that all LPEs are forked_if_necessary, we can apply the transform
- PathEffectList effect_list = lpeitem->getEffectList();
- for (PathEffectList::iterator it = effect_list.begin(); it != effect_list.end(); ++it)
- {
- LivePathEffectObject *lpeobj = (*it)->lpeobject;
- if (lpeobj) {
- Inkscape::LivePathEffect::Effect * lpe = lpeobj->get_lpe();
- if (lpe && lpe->isReady()) {
- lpe->transform_multiply(postmul, set);
- }
- }
- }
- }
-}
-
// CPPIFY:: make pure virtual?
// Not all SPItems must necessarily have a set transform method!
Geom::Affine SPItem::set_transform(Geom::Affine const &transform) {
diff --git a/src/object/sp-item.h b/src/object/sp-item.h
index 9b225a4bd..20d423692 100644
--- a/src/object/sp-item.h
+++ b/src/object/sp-item.h
@@ -335,8 +335,6 @@ public:
*/
void adjust_paint_recursive(Geom::Affine advertized_transform, Geom::Affine t_ancestors, bool is_pattern);
- void adjust_livepatheffect(Geom::Affine const &postmul, bool set = false);
-
/**
* Set a new transform on an object.
*
diff --git a/src/object/sp-path.cpp b/src/object/sp-path.cpp
index d3394c9b5..6456b52c5 100644
--- a/src/object/sp-path.cpp
+++ b/src/object/sp-path.cpp
@@ -347,20 +347,7 @@ Geom::Affine SPPath::set_transform(Geom::Affine const &transform) {
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))
- {
- // 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
- return transform;
- } else {
- _curve_before_lpe->transform(transform);
- }
- } else {
- _curve->transform(transform);
- }
+ _curve->transform(transform);
// Adjust stroke
this->adjust_stroke(transform.descrim());
diff --git a/src/splivarot.cpp b/src/splivarot.cpp
index b986af32e..f3e406599 100644
--- a/src/splivarot.cpp
+++ b/src/splivarot.cpp
@@ -715,7 +715,6 @@ BoolOpErrors Inkscape::ObjectSet::pathBoolOp(bool_op bop, const bool skip_undo,
item_source->adjust_stroke(i2doc.descrim());
item_source->adjust_pattern(i2doc);
item_source->adjust_gradient(i2doc);
- item_source->adjust_livepatheffect(i2doc);
Inkscape::XML::Node *repr_source = source->getRepr();