From 526fa89a4b18d46c60d5c48ecd8ed8165e73e071 Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Fri, 12 Mar 2021 11:03:54 +1100 Subject: [PATCH] Moved fog cut ids to shortids --- src/helpers/actions.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/helpers/actions.js b/src/helpers/actions.js index 58fb2e9..44c51b7 100644 --- a/src/helpers/actions.js +++ b/src/helpers/actions.js @@ -1,6 +1,8 @@ +import shortid from "shortid"; + export function addPolygonDifferenceToShapes(shape, difference, shapes) { for (let i = 0; i < difference.length; i++) { - let newId = `${shape.id}-dif-${i}`; + let newId = shortid.generate(); // Holes detected let holes = []; if (difference[i].length > 1) { @@ -24,7 +26,7 @@ export function addPolygonDifferenceToShapes(shape, difference, shapes) { export function addPolygonIntersectionToShapes(shape, intersection, shapes) { for (let i = 0; i < intersection.length; i++) { - let newId = `${shape.id}-int-${i}`; + let newId = shortid.generate(); const points = intersection[i][0].map(([x, y]) => ({ x, y }));