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:
iconexperience 2016-01-02 19:08:42 +01:00
parent b33777274d
commit ebaccf6e2d

View file

@ -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 ||