From 160f14d6527cbf8d057837b33a5cd46161c7f65e Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Fri, 23 Nov 2007 23:39:26 +0000 Subject: LPEbendpath fix: save widthfactor parameter ofcourse doh! (bzr r4131) --- src/live_effects/lpe-pathalongpath.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/live_effects/lpe-pathalongpath.cpp') 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(&bend_path) ); registerParameter( dynamic_cast(&width_path) ); + registerParameter( dynamic_cast(&width_path_range) ); registerParameter( dynamic_cast(©type) ); registerParameter( dynamic_cast(&prop_scale) ); registerParameter( dynamic_cast(&scale_y_rel) ); @@ -148,7 +150,7 @@ LPEPathAlongPath::doEffect_pwd2 (Geom::Piecewise > & pwd2 Piecewise > widthpwd2 = arc_length_parametrization(Piecewise >(width_path),2,.1); D2 > widthd2pw = make_cuts_independant(widthpwd2); - Piecewise width = (Piecewise(widthd2pw[Y]) - uskeletonbounds[Y].middle()) * wfactor; + Piecewise width = (Piecewise(widthd2pw[Y]) - uskeletonbounds[Y].middle()) / width_path_range; double offs = 0; @@ -195,7 +197,7 @@ LPEPathAlongPath::resetDefaults(SPItem * item) pathw.appendNew( 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 -- cgit v1.2.3