X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=ETL%2Ftrunk%2FETL%2F_bezier.h;h=4851a98419a329dcbddde766179261e1b8d01db7;hb=6d603393d410ef8f75165a435f4d638c7a66681e;hp=a08a42b466d986835a203306d221f85cc17be398;hpb=c8a995a81a8049f2d71c92d38ae8d7affbf312fb;p=synfig.git diff --git a/ETL/trunk/ETL/_bezier.h b/ETL/trunk/ETL/_bezier.h index a08a42b..4851a98 100644 --- a/ETL/trunk/ETL/_bezier.h +++ b/ETL/trunk/ETL/_bezier.h @@ -553,8 +553,7 @@ public: bezier::operator[](1), bezier::operator[](2), bezier::operator[](3)}; - float t = NearestPointOnCurve(x, array); - return t > 0.999999 ? 0.999999 : t < 0.000001 ? 0.000001 : t; + return NearestPointOnCurve(x, array); } else { @@ -578,6 +577,7 @@ public: distance_type find_distance(time_type r, time_type s, int steps=7)const { const time_type inc((s-r)/steps); + if (!inc) return 0; distance_type ret(0); value_type last(operator()(r));