summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-pathalongpath.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2007-11-23 23:39:26 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2007-11-23 23:39:26 +0000
commit160f14d6527cbf8d057837b33a5cd46161c7f65e (patch)
tree74529d2dc440e3529dc85e20d53717b281a58174 /src/live_effects/lpe-pathalongpath.cpp
parentLPE add experimental width control to bend path! (diff)
downloadinkscape-160f14d6527cbf8d057837b33a5cd46161c7f65e.tar.gz
inkscape-160f14d6527cbf8d057837b33a5cd46161c7f65e.zip
LPEbendpath fix: save widthfactor parameter ofcourse doh!
(bzr r4131)
Diffstat (limited to 'src/live_effects/lpe-pathalongpath.cpp')
-rw-r--r--src/live_effects/lpe-pathalongpath.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/live_effects/lpe-pathalongpath.cpp b/src/live_effects/lpe-pathalongpath.cpp
index e552bdaad..100d0428d 100644
--- a/src/live_effects/lpe-pathalongpath.cpp
+++ b/src/live_effects/lpe-pathalongpath.cpp
@@ -64,6 +64,7 @@ LPEPathAlongPath::LPEPathAlongPath(LivePathEffectObject *lpeobject) :
Effect(lpeobject),
bend_path(_("Bend path"), _("Path along which to bend the original path"), "bendpath", &wr, this, "M0,0 L1,0"),
width_path(_("Width path"), _("..."), "widthpath", &wr, this, "M0,0 L1,0"),
+ width_path_range(_("Width path range"), _("Range of widthpath parameter"), "widthpath_range", &wr, this, 1),
copytype(_("Path copies"), _("How many copies to place along the skeleton path"), "copytype", PAPCopyTypeConverter, &wr, this, PAPCT_SINGLE_STRETCHED),
prop_scale(_("Width"), _("Width of the path"), "prop_scale", &wr, this, 1),
scale_y_rel(_("Width in units of length"), _("Scale the width of the path in units of its length"), "scale_y_rel", &wr, this, false),
@@ -71,6 +72,7 @@ LPEPathAlongPath::LPEPathAlongPath(LivePathEffectObject *lpeobject) :
{
registerParameter( dynamic_cast<Parameter *>(&bend_path) );
registerParameter( dynamic_cast<Parameter *>(&width_path) );
+ registerParameter( dynamic_cast<Parameter *>(&width_path_range) );
registerParameter( dynamic_cast<Parameter *>(&copytype) );
registerParameter( dynamic_cast<Parameter *>(&prop_scale) );
registerParameter( dynamic_cast<Parameter *>(&scale_y_rel) );
@@ -148,7 +150,7 @@ LPEPathAlongPath::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2
Piecewise<D2<SBasis> > widthpwd2 = arc_length_parametrization(Piecewise<D2<SBasis> >(width_path),2,.1);
D2<Piecewise<SBasis> > widthd2pw = make_cuts_independant(widthpwd2);
- Piecewise<SBasis> width = (Piecewise<SBasis>(widthd2pw[Y]) - uskeletonbounds[Y].middle()) * wfactor;
+ Piecewise<SBasis> width = (Piecewise<SBasis>(widthd2pw[Y]) - uskeletonbounds[Y].middle()) / width_path_range;
double offs = 0;
@@ -195,7 +197,7 @@ LPEPathAlongPath::resetDefaults(SPItem * item)
pathw.appendNew<Geom::LineSegment>( endw );
width_path.param_set_and_write_new_value( pathw.toPwSb() );
- wfactor = 1/(startw[Y]-start[Y]);
+ width_path_range.param_set_value(startw[Y]-start[Y]);
}
} // namespace LivePathEffect