Moved fog cut ids to shortids

This commit is contained in:
Mitchell McCaffrey 2021-03-12 11:03:54 +11:00
parent e6fd10a904
commit 526fa89a4b

View File

@ -1,6 +1,8 @@
import shortid from "shortid";
export function addPolygonDifferenceToShapes(shape, difference, shapes) { export function addPolygonDifferenceToShapes(shape, difference, shapes) {
for (let i = 0; i < difference.length; i++) { for (let i = 0; i < difference.length; i++) {
let newId = `${shape.id}-dif-${i}`; let newId = shortid.generate();
// Holes detected // Holes detected
let holes = []; let holes = [];
if (difference[i].length > 1) { if (difference[i].length > 1) {
@ -24,7 +26,7 @@ export function addPolygonDifferenceToShapes(shape, difference, shapes) {
export function addPolygonIntersectionToShapes(shape, intersection, shapes) { export function addPolygonIntersectionToShapes(shape, intersection, shapes) {
for (let i = 0; i < intersection.length; i++) { 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 })); const points = intersection[i][0].map(([x, y]) => ({ x, y }));