Closed PancakeTAS closed 2 years ago
fetching the screen resolution with window.getSize() returns null for some reason
I assume you meant window resolution. I don't see why this would happen, but I guess for the meanwhile, maybe app.getConfig()
can be used to at least get the window size from the neutralino.config.json
file.
I'm also changing the PR title to mention that it's platform-specific, as to not defer anyone from continuing work on this issue for Linux or Mac.
Just for the record, in case someone comes back to this - the reason this doesn't work for Linux is because multiple monitors often seem to be treated as one display by Neutralino. This makes it treat two side-by-side 1080p monitors as one 3840x1080 display.
Added a small piece of code that scaled the resolution of the window with the dpi (on windows, this is the scale percentage) and resolution of the screen for the main monitor. Haven't found a way to do this once it moves onto another monitor.
Needs testing on linux I guess.
Another note, fetching the screen resolution with window.getSize() returns null for some reason, so the size needs to be entered in the code instead of read from the config. I'd keep minWidth and minHeight always the same.
gitignore is also kept very simple just to prevent pushing the wrong files in the future