From 1e8947af63661a3a35d5b7a4329b41bd37425bd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 4 May 2013 03:33:44 -0700 Subject: [PATCH] Further clean up. Instead of removing temporary data structure, clone Segment. --- src/path/PathItem.Boolean.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/path/PathItem.Boolean.js b/src/path/PathItem.Boolean.js index 96c5a945..972af1b7 100644 --- a/src/path/PathItem.Boolean.js +++ b/src/path/PathItem.Boolean.js @@ -165,19 +165,14 @@ PathItem.inject(new function() { segment.setHandleIn(last ? last._handleIn : Point.create(0, 0)); do { segment._visited = true; - if (segment._intersection) { - var next = segment._invalid - ? segment._intersection.getSegment(true) - : segment; + if (segment._intersection && segment._invalid) { + var next = segment._intersection.getSegment(true); path.add(new Segment(segment._point, segment._handleIn, next._handleOut)); next._visited = true; segment = next; } else { - // Remove temporary digraph data structures from segment - delete segment._invalid; - delete segment._intersection; - path.add(segment); + path.add(segment.clone()); } segment = segment.getNext(); } while (segment && !segment._visited && segment !== last);