From 44181644c51eb7b5755e0a1459a6ef04483f88c5 Mon Sep 17 00:00:00 2001 From: dooglus Date: Thu, 13 Sep 2007 12:44:31 +0000 Subject: [PATCH] When a curve gradient layer's bline is looped and perpendicular is checked, spread the gradient over the entire loop. Previously the last bline wasn't used. git-svn-id: http://svn.voria.com/code@663 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/modules/mod_gradient/curvegradient.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/synfig-core/trunk/src/modules/mod_gradient/curvegradient.cpp b/synfig-core/trunk/src/modules/mod_gradient/curvegradient.cpp index 508a464..9f2c42a 100644 --- a/synfig-core/trunk/src/modules/mod_gradient/curvegradient.cpp +++ b/synfig-core/trunk/src/modules/mod_gradient/curvegradient.cpp @@ -72,7 +72,7 @@ inline float calculate_distance(const synfig::BLinePoint& a,const synfig::BLineP #endif } -inline float calculate_distance(const std::vector& bline) +inline float calculate_distance(const std::vector& bline, bool bline_loop) { std::vector::const_iterator iter,next,ret; std::vector::const_iterator end(bline.end()); @@ -83,10 +83,10 @@ inline float calculate_distance(const std::vector& bline) next=bline.begin(); - //if(loop) - // iter=--bline.end(); - //else - iter=next++; + if(bline_loop) + iter=--bline.end(); + else + iter=next++; for(;next!=end;iter=next++) { @@ -197,7 +197,7 @@ find_closest(bool fast, const std::vector& bline,const Point inline void CurveGradient::sync() { - curve_length_=calculate_distance(bline); + curve_length_=calculate_distance(bline, bline_loop); } -- 2.7.4