Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Platform UI scaling #200

Merged
merged 8 commits into from
Sep 3, 2022
Merged

Platform UI scaling #200

merged 8 commits into from
Sep 3, 2022

Conversation

Gurchain
Copy link
Contributor

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.

@mbrlabs
Copy link
Owner

mbrlabs commented Sep 1, 2022

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.

@Gurchain
Copy link
Contributor Author

Gurchain commented Sep 2, 2022

@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:
Screenshot from 2022-09-02 01-18-18
It works slightly better

@mbrlabs
Copy link
Owner

mbrlabs commented Sep 2, 2022

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.

@mbrlabs mbrlabs merged commit 5e8211d into mbrlabs:main Sep 3, 2022
@mbrlabs
Copy link
Owner

mbrlabs commented Sep 3, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants