feat: fit map to screen size

This commit is contained in:
Azgaar 2023-11-19 16:51:59 +04:00
parent ada39b47ad
commit 1200b9e60f
8 changed files with 64 additions and 75 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);