mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Add break condition for exactly collinear curves to prevent a very time consuming clipping process that cannot have a result.
This commit is contained in:
parent
b33777274d
commit
ebaccf6e2d
1 changed files with 3 additions and 0 deletions
|
@ -1462,6 +1462,9 @@ new function() { // Scope for intersection using bezier fat-line clipping
|
|||
bottom = hull[1],
|
||||
tMinClip,
|
||||
tMaxClip;
|
||||
// Stop iteration if all points and control points are exactly collinear.
|
||||
if (d1 == 0 && d2 == 0 && dp0 == 0 && dp1 == 0 && dp2 == 0 && dp3 == 0)
|
||||
return;
|
||||
// Clip the convex-hull with dMin and dMax, taking into account that
|
||||
// there will be no intersections if one of the tvalues are null.
|
||||
if ((tMinClip = clipConvexHull(top, bottom, dMin, dMax)) == null ||
|
||||
|
|
Loading…
Reference in a new issue