Skip to content

Commit 439cace

Browse files
committed
Fix: Ensure heightmap elements are properly removed before re-insertion in editHeightmap function
1 parent a276b61 commit 439cace

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

public/modules/ui/heightmap-editor.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
function editHeightmap(options) {
44
const {mode, tool} = options || {};
55
restartHistory();
6+
viewbox.selectAll("#heights").remove();
67
viewbox.insert("g", "#terrs").attr("id", "heights");
78

89
if (!mode) showModeDialog();
@@ -188,7 +189,8 @@ function editHeightmap(options) {
188189

189190
// restore initial layers
190191
drawFeatures();
191-
byId("heights").remove();
192+
viewbox.selectAll("#heights").remove();
193+
192194
turnButtonOff("toggleHeight");
193195
document
194196
.getElementById("mapLayers")

0 commit comments

Comments
 (0)