From 7d25096de67b4442def4e1103b0619f8367ca418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 27 Dec 2015 16:55:26 +0100 Subject: [PATCH] Fix new failing #isCrossing() test-case. --- src/path/CurveLocation.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/path/CurveLocation.js b/src/path/CurveLocation.js index 04fbbab7..12551399 100644 --- a/src/path/CurveLocation.js +++ b/src/path/CurveLocation.js @@ -448,10 +448,14 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{ // Now pick the other two potential intersecting curves, // and check against each if they are straight: var l = c.getLine(), - ca = t1Inside ? c3 : c1, - cb = t1Inside ? c4 : c2; - return ca.isStraight() && l.intersect(ca.getLine()) || - cb.isStraight() && l.intersect(cb.getLine()); + l1 = t1Inside ? c3 : c1, + l2 = t1Inside ? c4 : c2, + straight1 = l1.isStraight(), + straight2 = l2.isStraight(); + if (straight1 || straight2) { + return straight1 && l.intersect(l1.getLine()) || + straight2 && l.intersect(l2.getLine()); + } } }