mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
feat: fitMapToScreen on canvas site restoring
This commit is contained in:
parent
54721f2100
commit
20b09e8634
1 changed files with 8 additions and 7 deletions
|
|
@ -178,6 +178,14 @@ function mapSizeInputChange() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function restoreDefaultCanvasSize() {
|
||||||
|
mapWidthInput.value = window.innerWidth;
|
||||||
|
mapHeightInput.value = window.innerHeight;
|
||||||
|
localStorage.removeItem("mapHeight");
|
||||||
|
localStorage.removeItem("mapWidth");
|
||||||
|
fitMapToScreen();
|
||||||
|
}
|
||||||
|
|
||||||
// on map creation
|
// on map creation
|
||||||
function applyGraphSize() {
|
function applyGraphSize() {
|
||||||
graphWidth = +mapWidthInput.value;
|
graphWidth = +mapWidthInput.value;
|
||||||
|
|
@ -212,13 +220,6 @@ function fitMapToScreen() {
|
||||||
if (window.fitLegendBox) fitLegendBox();
|
if (window.fitLegendBox) fitLegendBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
function restoreDefaultCanvasSize() {
|
|
||||||
mapWidthInput.value = window.innerWidth;
|
|
||||||
mapHeightInput.value = window.innerHeight;
|
|
||||||
localStorage.removeItem("mapHeight");
|
|
||||||
localStorage.removeItem("mapWidth");
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleTranslateExtent(el) {
|
function toggleTranslateExtent(el) {
|
||||||
const on = (el.dataset.on = +!+el.dataset.on);
|
const on = (el.dataset.on = +!+el.dataset.on);
|
||||||
if (on) {
|
if (on) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue