Skip to content

Commit

Permalink
Merge pull request #39 from zeli-b/dev/new-component
Browse files Browse the repository at this point in the history
increment id when new region
  • Loading branch information
junhg0211 authored Apr 23, 2024
2 parents d999ec8 + 2d2a761 commit 091e943
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,7 @@ function newRegion(points) {
const region = data.regions[i];
id = Math.max(id, region.id);
}
id++;

const name = prompt("이름");
const layer = parseInt(prompt("레이어"));
Expand Down Expand Up @@ -1133,9 +1134,10 @@ function newPath(points) {
const path = data.paths[i];
id = Math.max(path.id);
}
id++;

return {
id: id + 1,
id,
layer,
points,
name,
Expand Down

0 comments on commit 091e943

Please sign in to comment.