From ce6d11bc9a80c26d982d6b8a6df86b4edb3ce496 Mon Sep 17 00:00:00 2001 From: dooglus Date: Tue, 4 Nov 2008 14:45:06 +0000 Subject: [PATCH] Use a single scalar product to calculate the distance of each point from the bline. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2147 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/modules/mod_gradient/curvegradient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synfig-core/trunk/src/modules/mod_gradient/curvegradient.cpp b/synfig-core/trunk/src/modules/mod_gradient/curvegradient.cpp index e971a61..9e9a5ea 100644 --- a/synfig-core/trunk/src/modules/mod_gradient/curvegradient.cpp +++ b/synfig-core/trunk/src/modules/mod_gradient/curvegradient.cpp @@ -362,7 +362,7 @@ CurveGradient::color_func(const Point &point_, int quality, float supersample)co const Real mag(diff.inv_mag()); supersample=supersample*mag; diff*=mag*mag; - dist=((point_-origin)*diff-p1*diff); + dist=(point_-origin - p1)*diff; } } else // not perpendicular @@ -380,7 +380,7 @@ CurveGradient::color_func(const Point &point_, int quality, float supersample)co const Real mag(diff.inv_mag()); supersample=supersample*mag; diff*=mag*mag; - dist=((point_-origin)*diff-p1*diff); + dist=(point_-origin - p1)*diff; } if(loop) -- 2.7.4