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

SDL: Clip DPI scaling factor to ensure we get a reasonable value #4698

Merged
merged 1 commit into from
Feb 12, 2023

Conversation

criezy
Copy link
Member

@criezy criezy commented Feb 10, 2023

As shown by bug https://bugs.scummvm.org/ticket/14132, getting the DPI can be unreliable on some system, causing abnormal DPI scaling factor to be used. So I am proposing to clip the DPI scaling factor to a reasonable range. This should fix that bug since it will now return a factor of 1 instead of 0.289459 (I don't see any case where returning a value below 1 would make sense).

The change is simple, but I am creating a pull request in case I overlooked a possible issue with it.

@lotharsm
Copy link
Member

Looks good to me. This will ensure that the scaling factor will always be between 1.0 and 4.0, correct?

@neuromancer
Copy link
Contributor

I tested this PR in my 64'' TV screen. It improved the scale, but it still too small if you using Gnome scaling (in my case it's 300%), so I needed to use a base value of 3.0 as a reasonable value.

@lotharsm
Copy link
Member

Even though @neuromancer still had issues - I think this solves the potential problem for numerous users.

Should we merge this as-is and backport before doing some post-release fine-tuning?

@bluegr
Copy link
Member

bluegr commented Feb 12, 2023

This change looks good to me, it's a good compromise for unreliable system DPI scale values.

Next steps (which are out of scope of this PR) would be to allow overriding DPI via our GUI

@criezy criezy merged commit 8de1c2a into scummvm:master Feb 12, 2023
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.

5 participants