From 2e781fdf66683948c4db80d0dc08476e171447a2 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Sun, 26 Aug 2007 12:44:19 +0000 Subject: [PATCH] 2 LPE things: * Add changed signal to LPE PathParameter * removed origin parameter from path along path as it is not necessary any more --- src/live_effects/lpe-skeletalstrokes.cpp | 21 ++++++--------------- src/live_effects/lpe-skeletalstrokes.h | 2 -- src/live_effects/parameter/path.cpp | 1 + src/live_effects/parameter/path.h | 1 + 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/live_effects/lpe-skeletalstrokes.cpp b/src/live_effects/lpe-skeletalstrokes.cpp index 4e8a589ce..162dfe8a4 100644 --- a/src/live_effects/lpe-skeletalstrokes.cpp +++ b/src/live_effects/lpe-skeletalstrokes.cpp @@ -59,14 +59,10 @@ static const Util::EnumDataConverter SkelCopyTypeConverter(SkelCop LPESkeletalStrokes::LPESkeletalStrokes(LivePathEffectObject *lpeobject) : Effect(lpeobject), pattern(_("Pattern"), _("Path to put along path"), "pattern", &wr, this, "M0,0 L1,1"), - origin(_("Origin"), _("Startpoint of the pattern path to put along path"), "origin", &wr, this, Geom::Point(0,0)), copytype(_("Copytype"), _("How to shape the pattern path along the path"), "copytype", SkelCopyTypeConverter, &wr, this, SSCT_SINGLE_STRETCHED) { - registerParameter( dynamic_cast(&origin) ); registerParameter( dynamic_cast(&pattern) ); registerParameter( dynamic_cast(©type) ); - - pattern.signal_path_pasted.connect(sigc::mem_fun(*this, &LPESkeletalStrokes::on_pattern_pasted)); } LPESkeletalStrokes::~LPESkeletalStrokes() @@ -91,9 +87,13 @@ LPESkeletalStrokes::doEffect (Geom::Piecewise > & pwd2_in n = force_continuity(remove_short_cuts(n,.1)); D2 > patternd2 = make_cuts_independant(pattern); - Piecewise x=Piecewise(patternd2[0]-origin[0]); - Piecewise y=Piecewise(patternd2[1]-origin[1]); + Piecewise x=Piecewise(patternd2[0]); + Piecewise y=Piecewise(patternd2[1]); Interval pattBnds = bounds_exact(x); + x -= pattBnds.min(); + Interval pattBndsY = bounds_exact(y); + y -= (pattBndsY.max()+pattBndsY.min())/2; + int nbCopies = int(uskeleton.cuts.back()/pattBnds.extent()); double scaling = 1; @@ -121,7 +121,6 @@ LPESkeletalStrokes::doEffect (Geom::Piecewise > & pwd2_in double pattWidth = pattBnds.extent() * scaling; - x-=pattBnds.min(); if (scaling != 1) x*=scaling; @@ -134,14 +133,6 @@ LPESkeletalStrokes::doEffect (Geom::Piecewise > & pwd2_in return output; } -void -LPESkeletalStrokes::on_pattern_pasted() -{ - // a new pattern was pasted through the dialog. overwrite the origin thingie to the first point of the path - origin.param_setValue(pattern.valueAt(0)); -} - - } // namespace LivePathEffect } /* namespace Inkscape */ diff --git a/src/live_effects/lpe-skeletalstrokes.h b/src/live_effects/lpe-skeletalstrokes.h index 159a82f57..b92ea8ecf 100644 --- a/src/live_effects/lpe-skeletalstrokes.h +++ b/src/live_effects/lpe-skeletalstrokes.h @@ -11,7 +11,6 @@ #include "live_effects/effect.h" #include "live_effects/parameter/path.h" -#include "live_effects/parameter/point.h" #include "live_effects/parameter/enum.h" namespace Inkscape { @@ -34,7 +33,6 @@ public: private: PathParam pattern; - PointParam origin; EnumParam copytype; void on_pattern_pasted(); diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index f24fa933a..343a2f840 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -67,6 +67,7 @@ PathParam::param_readSVGValue(const gchar * strvalue) newpath.concat( temppath[i].toPwSb() ); } *( dynamic_cast > *> (this) ) = newpath; + signal_path_changed.emit(); return true; } diff --git a/src/live_effects/parameter/path.h b/src/live_effects/parameter/path.h index 0b0d5f633..e26611b85 100644 --- a/src/live_effects/parameter/path.h +++ b/src/live_effects/parameter/path.h @@ -41,6 +41,7 @@ public: void param_set_default(); sigc::signal signal_path_pasted; + sigc::signal signal_path_changed; private: PathParam(const PathParam&); -- 2.30.2