Bring back code removed in 11611c8fe2 again.

But add a _visited check, to get best of both approaches.
This commit is contained in:
Jürg Lehni 2015-10-02 18:57:45 -05:00
parent 00f1d5089f
commit 632eb25f19

View file

@ -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');