mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Revert 7dd0b852c8
Relates to https://github.com/paperjs/paper.js/issues/1233#issuecomment-269972157
This commit is contained in:
parent
46fce16bff
commit
ede9ef2623
1 changed files with 7 additions and 3 deletions
|
@ -699,6 +699,7 @@ statics: /** @lends Curve */{
|
||||||
var p1 = new Point(v[0], v[1]),
|
var p1 = new Point(v[0], v[1]),
|
||||||
p2 = new Point(v[6], v[7]),
|
p2 = new Point(v[6], v[7]),
|
||||||
epsilon = /*#=*/Numerical.EPSILON,
|
epsilon = /*#=*/Numerical.EPSILON,
|
||||||
|
geomEpsilon = /*#=*/Numerical.GEOMETRIC_EPSILON,
|
||||||
t = point.isClose(p1, epsilon) ? 0
|
t = point.isClose(p1, epsilon) ? 0
|
||||||
: point.isClose(p2, epsilon) ? 1
|
: point.isClose(p2, epsilon) ? 1
|
||||||
: null;
|
: null;
|
||||||
|
@ -711,13 +712,16 @@ statics: /** @lends Curve */{
|
||||||
var count = Curve.solveCubic(v, c, coords[c], roots, 0, 1);
|
var count = Curve.solveCubic(v, c, coords[c], roots, 0, 1);
|
||||||
for (var i = 0; i < count; i++) {
|
for (var i = 0; i < count; i++) {
|
||||||
var u = roots[i];
|
var u = roots[i];
|
||||||
if (point.isClose(Curve.getPoint(v, u),
|
if (point.isClose(Curve.getPoint(v, u), geomEpsilon))
|
||||||
/*#=*/Numerical.GEOMETRIC_EPSILON))
|
|
||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return t;
|
// Since we're comparing with geometric epsilon for any other t along
|
||||||
|
// the curve, do so as well now for the beginning and end of the curve.
|
||||||
|
return point.isClose(p1, geomEpsilon) ? 0
|
||||||
|
: point.isClose(p2, geomEpsilon) ? 1
|
||||||
|
: null;
|
||||||
},
|
},
|
||||||
|
|
||||||
getNearestTime: function(v, point) {
|
getNearestTime: function(v, point) {
|
||||||
|
|
Loading…
Reference in a new issue