Azgaar / Fantasy-Map-Generator

Web application generating interactive and highly customizable maps
https://azgaar.github.io/Fantasy-Map-Generator
Other
4.6k stars 661 forks source link

Map does not scale to fit screen size if it changed. #983

Closed cqb13 closed 1 year ago

cqb13 commented 1 year ago

If starting in a smaller browser window, and map is generated, if the browser window is then expanded, the map will stay small. The same applies for mobile devices, if the map is generated in portrait, but then the device is put into landscape, the map will will not expand to fit the new size.

Steps to reproduce

  1. Make browser window small
  2. Go onto website and make a new map. (have not tested loading existing maps)
  3. Expand browser window.

How map is when generating (works as expected at that size, no issue here)

image

After making window big, map does not expand.

image

System

There appear to be several functions in modules/ui/options.js that should be changing the maps size, in particular changeMapSize(), which says it should change svg size on manual size change or window resize, do not change graph size. I tried to use several of them, but most likely do to my very limited knowledge of the codebase, I was not successful. If chaning the map size after generation is not possible/reasonable to do, then maybe add an option to resize the map, by regenerating it with the same seed.

StempunkDev commented 1 year ago

That should be the intended way. From my experience it will only let you edit the part that is actually the graph, as told the graph will stay the same size. Referenced in: https://github.com/Azgaar/Fantasy-Map-Generator/blob/c3a385b2c90b153f058dc311e4085458a5f870c0/main.js#L208C1-L215C1

Azgaar commented 1 year ago

Yes, it's how it was build. Not sure how can it scale as aspect ration may change, should we leave some parts blank? Actually we may try auto scaling, should not be hard to do