diff --git a/index.html b/index.html index 651680fc..d631cde2 100644 --- a/index.html +++ b/index.html @@ -910,6 +910,13 @@ + + + + + + + diff --git a/main.js b/main.js index 75eba699..b7c797b8 100644 --- a/main.js +++ b/main.js @@ -479,7 +479,8 @@ function invokeActiveZooming() { if (this.id === "burgLabels") return; const desired = +this.dataset.size; const relative = Math.max(rn((desired + desired / scale) / 2, 2), 1); - this.setAttribute("font-size", relative); + if (rescaleLabels.checked) this.setAttribute("font-size", relative); + const hidden = hideLabels.checked && (relative * scale < 6 || relative * scale > 60); if (hidden) this.classList.add("hidden"); else this.classList.remove("hidden"); diff --git a/modules/load.js b/modules/load.js index b6ceaf98..323f3496 100644 --- a/modules/load.js +++ b/modules/load.js @@ -142,6 +142,7 @@ function parseLoadedData(data) { if (settings[20]) mapName.value = settings[20]; if (settings[21]) hideLabels.checked = +settings[21]; if (settings[22]) stylePreset.value = settings[22]; + if (settings[23]) rescaleLabels.checked = settings[23]; })(); void (function parseConfiguration() { diff --git a/modules/save.js b/modules/save.js index 277f4168..afcf859e 100644 --- a/modules/save.js +++ b/modules/save.js @@ -374,7 +374,7 @@ function getMapData() { const dateString = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate(); const license = "File can be loaded in azgaar.github.io/Fantasy-Map-Generator"; const params = [version, license, dateString, seed, graphWidth, graphHeight, mapId].join("|"); - const settings = [distanceUnitInput.value, distanceScaleInput.value, areaUnit.value, heightUnit.value, heightExponentInput.value, temperatureScale.value, barSizeInput.value, barLabel.value, barBackOpacity.value, barBackColor.value, barPosX.value, barPosY.value, populationRate, urbanization, mapSizeOutput.value, latitudeOutput.value, temperatureEquatorOutput.value, temperaturePoleOutput.value, precOutput.value, JSON.stringify(options), mapName.value, +hideLabels.checked, stylePreset.value].join("|"); + const settings = [distanceUnitInput.value, distanceScaleInput.value, areaUnit.value, heightUnit.value, heightExponentInput.value, temperatureScale.value, barSizeInput.value, barLabel.value, barBackOpacity.value, barBackColor.value, barPosX.value, barPosY.value, populationRate, urbanization, mapSizeOutput.value, latitudeOutput.value, temperatureEquatorOutput.value, temperaturePoleOutput.value, precOutput.value, JSON.stringify(options), mapName.value, +hideLabels.checked, stylePreset.value, +rescaleLabels.checked].join("|"); const coords = JSON.stringify(mapCoordinates); const biomes = [biomesData.color, biomesData.habitability, biomesData.name].join("|"); const notesData = JSON.stringify(notes);