Skip to content

Commit 2b3c045

Browse files
CopilotAzgaar
andauthored
Fix Markers layer button always enabled on load when layer was disabled (#1382)
* Initial plan * Fix Markers layer button always enabled on load when layer is disabled Agent-Logs-Url: https://github.com/Azgaar/Fantasy-Map-Generator/sessions/f076f8dd-0d93-423f-b87c-211b91f5dbc7 Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com>
1 parent 8f1968f commit 2b3c045

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

public/modules/io/load.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ async function parseLoadedData(data, mapVersion) {
456456
if (isVisible(labels)) turnOn("toggleLabels");
457457
if (isVisible(icons)) turnOn("toggleBurgIcons");
458458
if (hasChildren(armies) && isVisible(armies)) turnOn("toggleMilitary");
459-
if (hasChildren(markers)) turnOn("toggleMarkers");
459+
if (hasChild(markers, "svg")) turnOn("toggleMarkers");
460460
if (isVisible(ruler)) turnOn("toggleRulers");
461461
if (isVisible(scaleBar)) turnOn("toggleScaleBar");
462462
if (isVisibleNode(byId("vignette"))) turnOn("toggleVignette");

public/modules/ui/layers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ function toggleMarkers(event) {
829829
if (event && isCtrlClick(event)) editStyle("markers");
830830
} else {
831831
if (event && isCtrlClick(event)) return editStyle("markers");
832-
markers.selectAll("*").remove();
832+
markers.html("");
833833
turnButtonOff("toggleMarkers");
834834
}
835835
}

0 commit comments

Comments
 (0)