mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -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]),
|
||||
p2 = new Point(v[6], v[7]),
|
||||
epsilon = /*#=*/Numerical.EPSILON,
|
||||
geomEpsilon = /*#=*/Numerical.GEOMETRIC_EPSILON,
|
||||
t = point.isClose(p1, epsilon) ? 0
|
||||
: point.isClose(p2, epsilon) ? 1
|
||||
: null;
|
||||
|
@ -711,13 +712,16 @@ statics: /** @lends Curve */{
|
|||
var count = Curve.solveCubic(v, c, coords[c], roots, 0, 1);
|
||||
for (var i = 0; i < count; i++) {
|
||||
var u = roots[i];
|
||||
if (point.isClose(Curve.getPoint(v, u),
|
||||
/*#=*/Numerical.GEOMETRIC_EPSILON))
|
||||
if (point.isClose(Curve.getPoint(v, u), geomEpsilon))
|
||||
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) {
|
||||
|
|
Loading…
Reference in a new issue