From 085cdd74a2c49de1228aa0b996261b33743a0959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 12 Sep 2015 21:56:53 +0200 Subject: [PATCH] Use GEOMETRIC_EPSILON when comparing curve start / end points. Relates to #777 --- src/path/Curve.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/path/Curve.js b/src/path/Curve.js index 2507e88e..c686f0c5 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -1702,12 +1702,12 @@ new function() { // Scope for intersection using bezier fat-line clipping c1p2 = new Point(v1[6], v1[7]), c2p1 = new Point(v2[0], v2[1]), c2p2 = new Point(v2[6], v2[7]), - tolerance = /*#=*/Numerical.TOLERANCE; + epsilon = /*#=*/Numerical.GEOMETRIC_EPSILON; // Handle the special case where the first curve's stat-point // overlaps with the second curve's start- or end-points. - if (c1p1.isClose(c2p1, tolerance)) + if (c1p1.isClose(c2p1, epsilon)) addLocation(locations, param, v1, c1, 0, c1p1, v2, c2, 0, c1p1); - if (!param.startConnected && c1p1.isClose(c2p2, tolerance)) + if (!param.startConnected && c1p1.isClose(c2p2, epsilon)) addLocation(locations, param, v1, c1, 0, c1p1, v2, c2, 1, c1p1); // Determine the correct intersection method based on whether one or // curves are straight lines: @@ -1723,9 +1723,9 @@ new function() { // Scope for intersection using bezier fat-line clipping 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, tolerance)) + if (!param.endConnected && c1p2.isClose(c2p1, epsilon)) addLocation(locations, param, v1, c1, 1, c1p2, v2, c2, 0, c1p2); - if (c1p2.isClose(c2p2, tolerance)) + if (c1p2.isClose(c2p2, epsilon)) addLocation(locations, param, v1, c1, 1, c1p2, v2, c2, 1, c1p2); return locations; },