|
@@ -210,7 +210,7 @@ class ShapePath {
|
|
|
if ( newShapes.length > 1 ) {
|
|
|
|
|
|
let ambiguous = false;
|
|
|
- const toChange = [];
|
|
|
+ let toChange = 0;
|
|
|
|
|
|
for ( let sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) {
|
|
|
|
|
@@ -231,7 +231,8 @@ class ShapePath {
|
|
|
|
|
|
if ( isPointInsidePolygon( ho.p, newShapes[ s2Idx ].p ) ) {
|
|
|
|
|
|
- if ( sIdx !== s2Idx ) toChange.push( { froms: sIdx, tos: s2Idx, hole: hIdx } );
|
|
|
+ if ( sIdx !== s2Idx ) toChange ++;
|
|
|
+
|
|
|
if ( hole_unassigned ) {
|
|
|
|
|
|
hole_unassigned = false;
|
|
@@ -256,12 +257,10 @@ class ShapePath {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- // console.log("ambiguous: ", ambiguous);
|
|
|
|
|
|
- if ( toChange.length > 0 ) {
|
|
|
+ if ( toChange > 0 && ambiguous === false ) {
|
|
|
|
|
|
- // console.log("to change: ", toChange);
|
|
|
- if ( ! ambiguous ) newShapeHoles = betterShapeHoles;
|
|
|
+ newShapeHoles = betterShapeHoles;
|
|
|
|
|
|
}
|
|
|
|