hotfix: define color scheme on heightmap edit

This commit is contained in:
Azgaar 2023-11-06 00:04:53 +04:00
parent e654dbb8a5
commit 8101e75f3d
7 changed files with 37 additions and 36 deletions

View file

@ -94,6 +94,13 @@ function applyStyle(style) {
if (layerIsOn("toggleTexture") && selector === "#textureImage" && attribute === "src") {
el.setAttribute("href", value);
}
// add custom heightmap color scheme
if (selector === "#terrs" && attribute === "scheme" && !(value in heightmapColorSchemes)) {
const colors = value.split(",");
heightmapColorSchemes[value] = d3.scaleSequential(d3.interpolateRgbBasis(colors));
document.getElementById("styleHeightmapScheme").options.add(new Option(value, value));
}
}
}
}