X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=ETL%2Ftrunk%2FETL%2F_bezier.h;h=4851a98419a329dcbddde766179261e1b8d01db7;hb=bd4b3d17e246ddb8c76b8aa30367b26bddee3bc1;hp=67adc32d66cff15a8892c3961ec7acbda85dbf5e;hpb=37600b4b217caa5e316984ec0b035c5e8f9698af;p=synfig.git diff --git a/ETL/trunk/ETL/_bezier.h b/ETL/trunk/ETL/_bezier.h index 67adc32..4851a98 100644 --- a/ETL/trunk/ETL/_bezier.h +++ b/ETL/trunk/ETL/_bezier.h @@ -31,7 +31,8 @@ /* === H E A D E R S ======================================================= */ #include "_curve_func.h" -#include +#include // for ldexp +// #include // not used /* === M A C R O S ========================================================= */ @@ -552,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 { @@ -577,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));