mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51: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
|
||||
function applyGraphSize() {
|
||||
graphWidth = +mapWidthInput.value;
|
||||
|
|
@ -212,13 +220,6 @@ function fitMapToScreen() {
|
|||
if (window.fitLegendBox) fitLegendBox();
|
||||
}
|
||||
|
||||
function restoreDefaultCanvasSize() {
|
||||
mapWidthInput.value = window.innerWidth;
|
||||
mapHeightInput.value = window.innerHeight;
|
||||
localStorage.removeItem("mapHeight");
|
||||
localStorage.removeItem("mapWidth");
|
||||
}
|
||||
|
||||
function toggleTranslateExtent(el) {
|
||||
const on = (el.dataset.on = +!+el.dataset.on);
|
||||
if (on) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue