summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2007-08-26 12:44:19 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2007-08-26 12:44:19 +0000
commitc54cfe33b8031d6a5ba0995395ff36580b0d021a (patch)
tree7c2c2f529ee957cf2210b8f527ab5d35f8563ae7 /src
parentRename "Skeletal Strokes" LPE to "Path along path" to better describe what it... (diff)
downloadinkscape-c54cfe33b8031d6a5ba0995395ff36580b0d021a.tar.gz
inkscape-c54cfe33b8031d6a5ba0995395ff36580b0d021a.zip
2 LPE things:
* Add changed signal to LPE PathParameter * removed origin parameter from path along path as it is not necessary any more (bzr r3585)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/lpe-skeletalstrokes.cpp21
-rw-r--r--src/live_effects/lpe-skeletalstrokes.h2
-rw-r--r--src/live_effects/parameter/path.cpp1
-rw-r--r--src/live_effects/parameter/path.h1
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<SkelCopyType> 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<Parameter *>(&origin) );
registerParameter( dynamic_cast<Parameter *>(&pattern) );
registerParameter( dynamic_cast<Parameter *>(&copytype) );
-
- pattern.signal_path_pasted.connect(sigc::mem_fun(*this, &LPESkeletalStrokes::on_pattern_pasted));
}
LPESkeletalStrokes::~LPESkeletalStrokes()
@@ -91,9 +87,13 @@ LPESkeletalStrokes::doEffect (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in
n = force_continuity(remove_short_cuts(n,.1));
D2<Piecewise<SBasis> > patternd2 = make_cuts_independant(pattern);
- Piecewise<SBasis> x=Piecewise<SBasis>(patternd2[0]-origin[0]);
- Piecewise<SBasis> y=Piecewise<SBasis>(patternd2[1]-origin[1]);
+ Piecewise<SBasis> x=Piecewise<SBasis>(patternd2[0]);
+ Piecewise<SBasis> y=Piecewise<SBasis>(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<Geom::D2<Geom::SBasis> > & pwd2_in
double pattWidth = pattBnds.extent() * scaling;
- x-=pattBnds.min();
if (scaling != 1)
x*=scaling;
@@ -134,14 +133,6 @@ LPESkeletalStrokes::doEffect (Geom::Piecewise<Geom::D2<Geom::SBasis> > & 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<SkelCopyType> 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<Geom::Piecewise<Geom::D2<Geom::SBasis> > *> (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 <void> signal_path_pasted;
+ sigc::signal <void> signal_path_changed;
private:
PathParam(const PathParam&);