Draft: Improve femtovg rendering on high-DPI displays #9310
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DO NOT MERGE
This is a complete draft and I do not know what I'm doing.
Related to #6298 #6215 #5748 afaik.
What seems to be happening is that slint is doing its own handling of monitor scale factors/DPI scales greater than 1. At the same time, there's code in femtovg to handle this, but the logic is either somewhat botched or unaware of what slint is already doing. Such that if slint is already handling a scale factor of e.g. 1.5, then that is mistakenly being multiplied by another 1.5 in femtovg to produce a value of 2.25 that's doing something bad somewhere. Or something.
My changes here just remove the scale passed to femtovg and hardcode a value of
1.0
instead.Regardless, compare how the bevy example looks on my 1.566667 scale factor laptop monitor before and after this change. You might need to download the file and view it 1:1 to properly see the difference:
Even if this is indeed the correct solution here (I doubt it) then more cleanup work is needed.