From e477eb87889ef589aed4608d39a06e990fac296c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 13 Jan 2016 09:11:54 +0100 Subject: [PATCH] Reduce code-size a bit thanks to the use of epslion. See https://github.com/paperjs/paper.js/issues/878#issuecomment-168153188 --- src/path/Curve.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/path/Curve.js b/src/path/Curve.js index 271d5677..0278205b 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -1707,13 +1707,13 @@ new function() { // Scope for intersection using bezier fat-line clipping c2s2y = (3 * v2[5] + c2p2y) / 4, min = Math.min, max = Math.max; - if (!( max(c1p1x, c1s1x, c1s2x, c1p2x) + epsilon >= + if (!( max(c1p1x, c1s1x, c1s2x, c1p2x) + epsilon > min(c2p1x, c2s1x, c2s2x, c2p2x) && - min(c1p1x, c1s1x, c1s2x, c1p2x) - epsilon <= + min(c1p1x, c1s1x, c1s2x, c1p2x) - epsilon < max(c2p1x, c2s1x, c2s2x, c2p2x) && - max(c1p1y, c1s1y, c1s2y, c1p2y) + epsilon >= + max(c1p1y, c1s1y, c1s2y, c1p2y) + epsilon > min(c2p1y, c2s1y, c2s2y, c2p2y) && - min(c1p1y, c1s1y, c1s2y, c1p2y) - epsilon <= + min(c1p1y, c1s1y, c1s2y, c1p2y) - epsilon < max(c2p1y, c2s1y, c2s2y, c2p2y))) return locations; // Now detect and handle overlaps: