mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
disallow adding custom labels to state group
This commit is contained in:
parent
6d5c109d78
commit
19a8db4a17
2 changed files with 30 additions and 5 deletions
|
|
@ -470,9 +470,10 @@ function addLabelOnClick() {
|
|||
const id = getNextId("label");
|
||||
|
||||
// use most recently selected label group
|
||||
let selected = labelGroupSelect.value;
|
||||
const symbol = selected ? "#" + selected : "#addedLabels";
|
||||
let group = labels.select(symbol);
|
||||
const lastSelected = labelGroupSelect.value;
|
||||
const groupId = ["", "states", "burgLabels"].includes(lastSelected) ? "#addedLabels" : "#" + lastSelected;
|
||||
|
||||
let group = labels.select(groupId);
|
||||
if (!group.size())
|
||||
group = labels
|
||||
.append("g")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue