Use a single scalar product to calculate the distance of each point from the bline.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 4 Nov 2008 14:45:06 +0000 (14:45 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 4 Nov 2008 14:45:06 +0000 (14:45 +0000)
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

index e971a61..9e9a5ea 100644 (file)
@@ -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)