From 374fc4a32ec72869ac12998084d5151cae302708 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Thu, 12 Apr 2018 11:06:47 +0200 Subject: [PATCH] remove old path when joining two paths #42 --- src/sliceActions/intersectionsToShapes.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sliceActions/intersectionsToShapes.js b/src/sliceActions/intersectionsToShapes.js index 7b8b58f..7111103 100644 --- a/src/sliceActions/intersectionsToShapes.js +++ b/src/sliceActions/intersectionsToShapes.js @@ -59,6 +59,7 @@ export default function intersectionsToShapes(layerPoints, layerFaceIndexes, fac } else { lineSegment.push(...startConnects[pointB]); endConnects[lineSegment[lineSegment.length - 1]] = lineSegment; + shapes[objectIndex].splice(shapes[objectIndex].indexOf(startConnects[pointB]), 1); } } else { lineSegment.push(pointB); @@ -70,6 +71,7 @@ export default function intersectionsToShapes(layerPoints, layerFaceIndexes, fac if (endConnects[pointA]) { lineSegment.unshift(...endConnects[pointA]); startConnects[lineSegment[0]] = lineSegment; + shapes[objectIndex].splice(shapes[objectIndex].indexOf(endConnects[pointA]), 1); } else { lineSegment.unshift(pointA); startConnects[pointA] = lineSegment;