mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
select template correctly
This commit is contained in:
parent
395a7c28a9
commit
c2ceb227ad
2 changed files with 3 additions and 3 deletions
|
|
@ -9,7 +9,8 @@ window.HeightmapGenerator = (function () {
|
||||||
cells.h = new Uint8Array(grid.points.length);
|
cells.h = new Uint8Array(grid.points.length);
|
||||||
|
|
||||||
const input = document.getElementById("templateInput");
|
const input = document.getElementById("templateInput");
|
||||||
const type = input.querySelector(`[value=${input.value}]`).parentElement.label;
|
const selectedId = input.selectedIndex >= 0 ? input.selectedIndex : 0;
|
||||||
|
const type = input.options[selectedId]?.parentElement?.label;
|
||||||
|
|
||||||
if (type === "Specific") {
|
if (type === "Specific") {
|
||||||
// pre-defined heightmap
|
// pre-defined heightmap
|
||||||
|
|
|
||||||
|
|
@ -536,10 +536,9 @@ class Planimeter extends Measurer {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scale bar
|
// Scale bar
|
||||||
function drawScaleBar(requestedScale) {
|
function drawScaleBar(scaleLevel = scale) {
|
||||||
if (scaleBar.style("display") === "none") return; // no need to re-draw hidden element
|
if (scaleBar.style("display") === "none") return; // no need to re-draw hidden element
|
||||||
scaleBar.selectAll("*").remove(); // fully redraw every time
|
scaleBar.selectAll("*").remove(); // fully redraw every time
|
||||||
const scaleLevel = requestedScale || scale;
|
|
||||||
|
|
||||||
const distanceScale = distanceScaleInput.value;
|
const distanceScale = distanceScaleInput.value;
|
||||||
const unit = distanceUnitInput.value;
|
const unit = distanceUnitInput.value;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue