Closed Gurchain closed 2 years ago
Thanks! That change makes sense indeed.
The scaling for Linux could probably be improved further, but will be much easier if Godot implements better scaling/dpi support in the engine itself.
What's currently missing? Isn't OS.get_screen_dpi()
supposed to work on Linux as well?
Also maybe this would fix #190, but hard to tell based on the non-existint issue description.
@mbrlabs I meant that the scaling could more cohesive with the different desktop environments on linux (which dont manipulate the dpi when they scale). It would be better to scale based on what the system scale is rather than calculating the scale from the dpi, but that's not available.
For OS.get_screen_dpi(), the dpi that X11 returns, can be off by like + or - 20 in my experience.
Im also a bit worried about edge cases where a hidpi display return the default X11 dpi (96), but I don't know how often that happens.
If the last point isn't a problem I also have this implementation: It works slightly better
Ah i see, good to know. Well i guess the Godot editor workaround is pretty battle-tested, so id's say use that instead. Otherwise it's good to go.
Thanks!
Calculate UI auto scaling based on platform for more accurate scaling. Also wider range of allowed UI scales for some displays.
The scaling for Linux could probably be improved further, but will be much easier if Godot implements better scaling/dpi support in the engine itself.