mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
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:
parent
a349d40868
commit
a1f70afd57
7 changed files with 67 additions and 80 deletions
4
main.js
4
main.js
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue