mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-04 03:45:58 -05:00
Improve fat line clipping to fix #1088
Only alternate curves in addCurveIntersections() if interval on other curve is not tight enough yet.
This commit is contained in:
parent
f988445dad
commit
4c61153bd4
1 changed files with 8 additions and 2 deletions
|
@ -1709,9 +1709,15 @@ new function() { // Scope for intersection using bezier fat-line clipping
|
||||||
u, uMax, tMinNew, tMaxNew, !flip, recursion, calls);
|
u, uMax, tMinNew, tMaxNew, !flip, recursion, calls);
|
||||||
}
|
}
|
||||||
} else { // Iterate
|
} else { // Iterate
|
||||||
calls = addCurveIntersections(
|
if (uMax - uMin >= /*#=*/Numerical.CLIPPING_EPSILON) {
|
||||||
v2, v1, c2, c1, locations, param,
|
calls = addCurveIntersections(v2, v1, c2, c1, locations, param,
|
||||||
uMin, uMax, tMinNew, tMaxNew, !flip, recursion, calls);
|
uMin, uMax, tMinNew, tMaxNew, !flip, recursion, calls);
|
||||||
|
} else {
|
||||||
|
// The interval on the other curve is already tight enough,
|
||||||
|
// therefore we keep iterating on the same curve.
|
||||||
|
calls = addCurveIntersections(v1, v2, c1, c2, locations, param,
|
||||||
|
tMinNew, tMaxNew, uMin, uMax, flip, recursion, calls);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return calls;
|
return calls;
|
||||||
|
|
Loading…
Reference in a new issue