From 3d79ef05e2a016d1b6f3b86de2a67bcca845eb6b Mon Sep 17 00:00:00 2001 From: jfbarraud Date: Sun, 10 Feb 2008 22:50:35 +0000 Subject: [PATCH] revert to previous version. --- src/live_effects/lpe-skeletalstrokes.cpp | 29 ++++++++---------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/src/live_effects/lpe-skeletalstrokes.cpp b/src/live_effects/lpe-skeletalstrokes.cpp index ea1610546..6ba9ac65c 100644 --- a/src/live_effects/lpe-skeletalstrokes.cpp +++ b/src/live_effects/lpe-skeletalstrokes.cpp @@ -72,14 +72,13 @@ LPESkeletalStrokes::LPESkeletalStrokes(LivePathEffectObject *lpeobject) : registerParameter( dynamic_cast(©type) ); registerParameter( dynamic_cast(&prop_scale) ); registerParameter( dynamic_cast(&scale_y_rel) ); - registerParameter( dynamic_cast(&spacing) ); - registerParameter( dynamic_cast(&normal_offset) ); - registerParameter( dynamic_cast(&tang_offset) ); +// registerParameter( dynamic_cast(&spacing) ); +// registerParameter( dynamic_cast(&normal_offset) ); +// registerParameter( dynamic_cast(&tang_offset) ); registerParameter( dynamic_cast(&vertical_pattern) ); prop_scale.param_set_digits(3); prop_scale.param_set_increments(0.01, 0.10); - tang_offset.param_set_range(0, NR_HUGE); } LPESkeletalStrokes::~LPESkeletalStrokes() @@ -106,37 +105,28 @@ LPESkeletalStrokes::doEffect_pwd2 (Geom::Piecewise > & pw Piecewise x = vertical_pattern.get_value() ? Piecewise(patternd2[1]) : Piecewise(patternd2[0]); Piecewise y = vertical_pattern.get_value() ? Piecewise(patternd2[0]) : Piecewise(patternd2[1]); Interval pattBnds = bounds_exact(x); - x -= pattBnds.min(); + x -= pattBnds.min(); Interval pattBndsY = bounds_exact(y); - y -= pattBndsY.middle()+normal_offset; + y -= pattBndsY.middle(); - //Prevent more than 90% overlap... - if (spacing < -pattBnds.extent()*.9) { - spacing.param_set_value(-pattBnds.extent()*.9); - } - - int nbCopies = 0; + int nbCopies = int(uskeleton.cuts.back()/pattBnds.extent()); double scaling = 1; switch(type) { case SSCT_REPEATED: - nbCopies = floor((uskeleton.domain().extent() - tang_offset + spacing)/(pattBnds.extent()+spacing)); - pattBnds = Interval(pattBnds.min(),pattBnds.max()+spacing); break; case SSCT_SINGLE: - nbCopies = (tang_offset + pattBnds.extent() < uskeleton.domain().extent()) ? 1 : 0; + nbCopies = (nbCopies > 0) ? 1 : 0; break; case SSCT_SINGLE_STRETCHED: nbCopies = 1; - scaling = (uskeleton.domain().extent() - tang_offset)/pattBnds.extent(); + scaling = uskeleton.cuts.back()/pattBnds.extent(); break; case SSCT_REPEATED_STRETCHED: - nbCopies = std::floor((uskeleton.domain().extent() - tang_offset + spacing)/(pattBnds.extent()+spacing)); - pattBnds = Interval(pattBnds.min(),pattBnds.max()+spacing); - scaling = (uskeleton.domain().extent() - tang_offset)/(((double)nbCopies)*pattBnds.extent() - spacing); + scaling = uskeleton.cuts.back()/(((double)nbCopies)*pattBnds.extent()); break; default: @@ -153,7 +143,6 @@ LPESkeletalStrokes::doEffect_pwd2 (Geom::Piecewise > & pw } else { if (prop_scale != 1.0) y *= prop_scale; } - x += tang_offset; double offs = 0; Piecewise > output; -- 2.30.2