Fit map to screen size (#1018)

* feat: fit map to screen size

* chore: pump version

---------

Co-authored-by: Azgaar <azgaar.fmg@yandex.com>
This commit is contained in:
Azgaar 2023-11-19 17:03:48 +04:00 committed by GitHub
parent a349d40868
commit a1f70afd57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 67 additions and 80 deletions

View file

@ -308,6 +308,7 @@ async function generateMapOnLoad() {
await generate(); // generate map
focusOn(); // based on searchParams focus on point, cell or burg from MFCG
applyPreset(); // apply saved layers preset
fitMapToScreen();
}
// focus on coordinates, cell or burg provided in searchParams
@ -607,7 +608,7 @@ async function generate(options) {
setSeed(precreatedSeed);
INFO && console.group("Generated Map " + seed);
applyMapSize();
applyGraphSize();
randomizeOptions();
if (shouldRegenerateGrid(grid, precreatedSeed)) grid = precreatedGraph || generateGrid();
@ -1942,6 +1943,7 @@ const regenerateMap = debounce(async function (options) {
if (ThreeD.options.isOn) ThreeD.redraw();
if ($("#worldConfigurator").is(":visible")) editWorld();
fitMapToScreen();
shouldShowLoading && hideLoading();
clearMainTip();
}, 250);