From 987fb294fec5cb0860704545ccd04c9b0e3db749 Mon Sep 17 00:00:00 2001 From: Rowan Winsemius Date: Mon, 4 Apr 2022 20:47:02 +1000 Subject: [PATCH] flip transition if swapping between hole & exterior --- src/connect_edges.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/connect_edges.js b/src/connect_edges.js index 0ce5c43..7cc9f00 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -96,7 +96,12 @@ function initializeContourFromContext(event, contours, contourId) { // in an earlier iteration, otherwise it wouldn't be possible that it is "previous in // result". const lowerContourId = prevInResult.outputContourId; - const lowerResultTransition = prevInResult.resultTransition; + let lowerResultTransition = prevInResult.resultTransition; + + if (!event.isExteriorRing && prevInResult.isExteriorRing) { + lowerResultTransition = 1; + } + if (lowerResultTransition > 0) { // We are inside. Now we have to check if the thing below us is another hole or // an exterior contour.