Skip to content

Commit ef69952

Browse files
CopilotAzgaar
andauthored
Fix Wind Rose not displayed after new map generation (#1415)
* Initial plan * fix: re-append compass rose use element after undraw on map regeneration Agent-Logs-Url: https://github.com/Azgaar/Fantasy-Map-Generator/sessions/0c1f6a22-f14f-4484-83eb-e79ff22a8551 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 3a5426f commit ef69952

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

public/modules/ui/layers.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,10 @@ function drawLayers() {
197197
if (layerIsOn("toggleCells")) drawCells();
198198
if (layerIsOn("toggleGrid")) drawGrid();
199199
if (layerIsOn("toggleCoordinates")) drawCoordinates();
200-
if (layerIsOn("toggleCompass")) compass.style("display", "block");
200+
if (layerIsOn("toggleCompass")) {
201+
if (!compass.select("use").size()) compass.append("use").attr("xlink:href", "#defs-compass-rose");
202+
compass.style("display", "block");
203+
}
201204
if (layerIsOn("toggleRivers")) drawRivers();
202205
if (layerIsOn("toggleRelief")) drawReliefIcons();
203206
if (layerIsOn("toggleReligions")) drawReligions();
@@ -694,6 +697,7 @@ function drawCoordinates() {
694697
function toggleCompass(event) {
695698
if (!layerIsOn("toggleCompass")) {
696699
turnButtonOn("toggleCompass");
700+
if (!compass.select("use").size()) compass.append("use").attr("xlink:href", "#defs-compass-rose");
697701
$("#compass").fadeIn();
698702
if (event && isCtrlClick(event)) editStyle("compass");
699703
} else {

0 commit comments

Comments
 (0)