Exclude 1 in parameter range for crossing counting, as segment points would be counted twice otherwise.

This commit is contained in:
Jürg Lehni 2012-12-15 02:27:36 -08:00
parent 16578e6b15
commit 09ee9a0689

View file

@ -319,7 +319,7 @@ var Curve = this.Curve = Base.extend(/** @lends Curve# */{
crossings = 0;
for (var i = 0; i < count; i++) {
var t = roots[i];
if (t >= 0 && t <= 1 && Curve.evaluate(vals, t, 0).x > point.x) {
if (t >= 0 && t < 1 && Curve.evaluate(vals, t, 0).x > point.x) {
// If we're close to 0 and are not changing y-direction from the
// previous curve, do not count this root, as we're merely
// touching a tip. Passing 1 for Curve.evaluate()'s type means