From 632eb25f19fbbe5b1aeb607b1badab181a5bdbb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Fri, 2 Oct 2015 18:57:45 -0500 Subject: [PATCH] Bring back code removed in 11611c8fe2aa2001661c4ed43105d94c15905c7d again. But add a _visited check, to get best of both approaches. --- src/path/PathItem.Boolean.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/path/PathItem.Boolean.js b/src/path/PathItem.Boolean.js index 67df1943a0..b64c24a21b 100644 --- a/src/path/PathItem.Boolean.js +++ b/src/path/PathItem.Boolean.js @@ -680,7 +680,11 @@ PathItem.inject(new function() { // switch at each crossing. drawSegment(seg, other, 'exclude-cross', i, 'green'); seg = other; - } else if (isValid(other)) { + } else if (!seg._visited && isValid(seg)) { + // Do not switch to the intersecting segment as this segment + // is part of the the boolean result. + drawSegment(seg, null, 'keep', i, 'black'); + } else if (!other._visited && isValid(other)) { // The other segment is part of the boolean result, and we // are at crossing, switch over. drawSegment(seg, other, 'cross', i, 'green');