projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert the accidental removal of mod_libavcodec in r2286.
[synfig.git]
/
ETL
/
trunk
/
ETL
/
_bezier.h
diff --git
a/ETL/trunk/ETL/_bezier.h
b/ETL/trunk/ETL/_bezier.h
index
fe7ba8c
..
4851a98
100644
(file)
--- a/
ETL/trunk/ETL/_bezier.h
+++ b/
ETL/trunk/ETL/_bezier.h
@@
-4,6
+4,7
@@
** $Id$
**
** Copyright (c) 2002 Robert B. Quattlebaum Jr.
** $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
**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
@@
-30,7
+31,8
@@
/* === H E A D E R S ======================================================= */
#include "_curve_func.h"
/* === H E A D E R S ======================================================= */
#include "_curve_func.h"
-#include <ETL/fixed>
+#include <cmath> // for ldexp
+// #include <ETL/fixed> // not used
/* === M A C R O S ========================================================= */
/* === M A C R O S ========================================================= */
@@
-551,8
+553,7
@@
public:
bezier<V,T>::operator[](1),
bezier<V,T>::operator[](2),
bezier<V,T>::operator[](3)};
bezier<V,T>::operator[](1),
bezier<V,T>::operator[](2),
bezier<V,T>::operator[](3)};
- float t = NearestPointOnCurve(x, array);
- return t > 0.999999 ? 0.999999 : t < 0.000001 ? 0.000001 : t;
+ return NearestPointOnCurve(x, array);
}
else
{
}
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);
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));
distance_type ret(0);
value_type last(operator()(r));
@@
-926,7
+928,7
@@
private:
/*
* NearestPointOnCurve :
* Compute the parameter value of the point on a Bezier
/*
* NearestPointOnCurve :
* Compute the parameter value of the point on a Bezier
- * curve segment closest to some arb
t
itrary, user-input point.
+ * curve segment closest to some arbitrary, user-input point.
* Return the point on the curve at that parameter value.
*
* value_type& P; The user-supplied point
* Return the point on the curve at that parameter value.
*
* value_type& P; The user-supplied point