From: dooglus Date: Tue, 4 Nov 2008 14:45:06 +0000 (+0000) Subject: Use a single scalar product to calculate the distance of each point from the bline. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=ce6d11bc9a80c26d982d6b8a6df86b4edb3ce496;p=synfig.git 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 --- 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)