mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-02-04 17:41: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
|
|
@ -33,13 +33,16 @@ function drawBurgLabels() {
|
|||
}
|
||||
|
||||
function drawBurgLabel(burg) {
|
||||
removeBurgLabel(burg.i);
|
||||
|
||||
const labelGroup = burgLabels.select("#" + burg.group);
|
||||
if (labelGroup.empty()) return;
|
||||
if (labelGroup.empty()) {
|
||||
drawBurgLabels();
|
||||
return; // redraw all labels if group is missing
|
||||
}
|
||||
|
||||
const dx = labelGroup.attr("data-dx") || 0;
|
||||
const dy = labelGroup.attr("data-dy") || 0;
|
||||
|
||||
removeBurgLabel(burg.i);
|
||||
labelGroup
|
||||
.append("text")
|
||||
.attr("text-rendering", "optimizeSpeed")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue