mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-02-05 01:51:23 +01:00
fix: if group is missing, recreate all labels or icons
This commit is contained in:
parent
753db70283
commit
fa8fd58259
6 changed files with 44 additions and 48 deletions
|
|
@ -31,11 +31,13 @@ function drawBurgIcons() {
|
|||
}
|
||||
|
||||
function drawBurgIcon(burg) {
|
||||
removeBurgIcon(burg.i);
|
||||
|
||||
const iconGroup = burgIcons.select("#" + burg.group);
|
||||
if (iconGroup.empty()) return;
|
||||
if (iconGroup.empty()) {
|
||||
drawBurgIcons();
|
||||
return; // redraw all icons if group is missing
|
||||
}
|
||||
|
||||
removeBurgIcon(burg.i);
|
||||
const icon = iconGroup.attr("data-icon") || "#icon-circle";
|
||||
burgIcons
|
||||
.select("#" + burg.group)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue