Fix 1672033: when deciding which curve we are closest to, ignore the very ends of...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 23 Apr 2007 09:34:16 +0000 (09:34 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 23 Apr 2007 09:34:16 +0000 (09:34 +0000)
git-svn-id: http://svn.voria.com/code@481 1f10aa63-cdf2-0310-b900-c93c546f37ac

ETL/trunk/ETL/_bezier.h

index 7e26796..0e3ace9 100644 (file)
@@ -551,7 +551,8 @@ public:
                                bezier<V,T>::operator[](1),
                                bezier<V,T>::operator[](2),
                                bezier<V,T>::operator[](3)};
-                       return NearestPointOnCurve(x, array);
+                       float t = NearestPointOnCurve(x, array);
+                       return t > 0.999999 ? 0.999999 : t < 0.000001 ? 0.000001 : t;
            }
            else
            {