X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=ETL%2Ftrunk%2FETL%2F_bezier.h;h=fe6b17017f1e89b13a62f40efbc9f3ed67322d58;hb=e0dedc46e8ab6b258be81887689b0c0fd60def0c;hp=cf04ad31ea9af09aa6e8e764882994e68f7563b7;hpb=01ac089e243c721d088a117cc7a8505cb5da80d8;p=synfig.git diff --git a/ETL/trunk/ETL/_bezier.h b/ETL/trunk/ETL/_bezier.h index cf04ad3..fe6b170 100644 --- a/ETL/trunk/ETL/_bezier.h +++ b/ETL/trunk/ETL/_bezier.h @@ -4,6 +4,7 @@ ** $Id$ ** ** Copyright (c) 2002 Robert B. Quattlebaum Jr. +** Copyright (c) 2007 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 @@ -24,13 +25,14 @@ /* === S T A R T =========================================================== */ -#ifndef __ETL_BEZIER_H -#define __ETL_BEZIER_H +#ifndef __ETL__BEZIER_H +#define __ETL__BEZIER_H /* === H E A D E R S ======================================================= */ #include "_curve_func.h" -#include +#include // for ldexp +// #include // not used /* === M A C R O S ========================================================= */ @@ -551,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 { @@ -576,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));