Use a single scalar product to calculate the distance of each point from the bline.
[synfig.git] / synfig-core / trunk / src / modules / mod_gradient / curvegradient.cpp
index 7a489b7..9e9a5ea 100644 (file)
@@ -6,7 +6,7 @@
 **
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
-**     Copyright (c) 2007 Chris Moore
+**     Copyright (c) 2007-2008 Chris Moore
 **
 **     This package is free software; you can redistribute it and/or
 **     modify it under the terms of the GNU General Public License as
@@ -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)