diff --git a/src/path/Curve.js b/src/path/Curve.js index d6b37f1a..4dbc0f91 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -1868,12 +1868,16 @@ new function() { // Scope for intersection using bezier fat-line clipping // NOTE: Use smaller Numerical.EPSILON to compare beginnings and // end points to avoid matching them on almost collinear lines. epsilon = /*#=*/Numerical.EPSILON; - // Handle the special case where the first curve's stat-point - // overlaps with the second curve's start- or end-points. + // Handle the special case where the first curve's start- or end- + // point overlap with the second curve's start- or end-point. if (c1p1.isClose(c2p1, epsilon)) addLocation(locations, param, v1, c1, 0, c1p1, v2, c2, 0, c2p1); if (!param.startConnected && c1p1.isClose(c2p2, epsilon)) addLocation(locations, param, v1, c1, 0, c1p1, v2, c2, 1, c2p2); + if (!param.endConnected && c1p2.isClose(c2p1, epsilon)) + addLocation(locations, param, v1, c1, 1, c1p2, v2, c2, 0, c2p1); + if (c1p2.isClose(c2p2, epsilon)) + addLocation(locations, param, v1, c1, 1, c1p2, v2, c2, 1, c2p2); // Determine the correct intersection method based on whether one or // curves are straight lines: (straight1 && straight2 @@ -1886,12 +1890,6 @@ new function() { // Scope for intersection using bezier fat-line clipping // addCurveIntersections(): // tMin, tMax, uMin, uMax, oldTDiff, reverse, recursion 0, 1, 0, 1, 0, false, 0); - // Handle the special case where the first curve's end-point - // overlaps with the second curve's start- or end-points. - if (!param.endConnected && c1p2.isClose(c2p1, epsilon)) - addLocation(locations, param, v1, c1, 1, c1p2, v2, c2, 0, c2p1); - if (c1p2.isClose(c2p2, epsilon)) - addLocation(locations, param, v1, c1, 1, c1p2, v2, c2, 1, c2p2); return locations; } }};