mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Compare intersection points instead of curve time when deciding to merge.
Use same precision indepenent of curve length.
This commit is contained in:
parent
fec479167c
commit
7aef20ae6b
2 changed files with 3 additions and 4 deletions
|
@ -1662,6 +1662,7 @@ new function() { // Scope for intersection using bezier fat-line clipping
|
|||
if (pairs.length === 1 && pair[0] < pairs[0][0]) {
|
||||
pairs.unshift(pair);
|
||||
} else if (pairs.length === 0
|
||||
// TODO: Compare distance of points instead!
|
||||
|| abs(pair[0] - pairs[0][0]) > timeEpsilon
|
||||
|| abs(pair[1] - pairs[0][1]) > timeEpsilon) {
|
||||
pairs.push(pair);
|
||||
|
|
|
@ -284,10 +284,8 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{
|
|||
|| loc instanceof CurveLocation
|
||||
// Call getCurve() and getParameter() to keep in sync
|
||||
&& this.getCurve() === loc.getCurve()
|
||||
// Use the same tolerance for curve time parameter
|
||||
// comparisons as in Curve.js
|
||||
&& Math.abs(this.getParameter() - loc.getParameter())
|
||||
< /*#=*/Numerical.CURVETIME_EPSILON
|
||||
&& this.getPoint().isClose(loc.getPoint(),
|
||||
/*#=*/Numerical.GEOMETRIC_EPSILON)
|
||||
&& (_ignoreIntersection
|
||||
|| (!this._intersection && !loc._intersection
|
||||
|| this._intersection && this._intersection.equals(
|
||||
|
|
Loading…
Reference in a new issue