From: johanengelen Date: Fri, 23 Nov 2007 23:39:26 +0000 (+0000) Subject: LPEbendpath fix: save widthfactor parameter ofcourse doh! X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6396752b75f2248658d87eb59b754bb5e2fae30d;p=inkscape.git LPEbendpath fix: save widthfactor parameter ofcourse doh! --- 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 diff --git a/src/live_effects/lpe-pathalongpath.h b/src/live_effects/lpe-pathalongpath.h index b75d5e227..915cad8b0 100644 --- a/src/live_effects/lpe-pathalongpath.h +++ b/src/live_effects/lpe-pathalongpath.h @@ -37,11 +37,11 @@ public: private: PathParam bend_path; PathParam width_path; + ScalarParam width_path_range; EnumParam copytype; ScalarParam prop_scale; BoolParam scale_y_rel; BoolParam vertical_pattern; - double wfactor; void on_pattern_pasted();