Fix the rounding of the size of fractionally scaled monitors #5748
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.
Describe your PR, what does it fix/add?
This fixes the issue of some monitors with fractional scaling having their vecSize 1 pixel less than they should be. In my case, my 2560x1600 monitor with 1.33x scaling would end up with dimensions 1919.999...x1119.999..., which would then get floored to 1919x1119. This caused a 1-pixel outline around the edges of the monitor where nothing happened (very visible if I set background_color to 0x00ff0000 or something and fullscreened anything or had a dark wallpaper. The problem would be exacerbated if external monitors are positioned with auto, because due to the incorrect vecSize the monitors would end up actually overlapping by a single pixel. This would cause all sorts of problems like vfr breaking on certain fullscreened apps (firefox in particular) and also popup menus not working on fullscreened apps for some reason.
Fixes:
#3511
#3778
#4474
#4781
and possibly #5399 (not sure if related)
Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
I'm not sure if this is the right way to go about this and it might still have problems if there is no clean divisor for the scaling factor but it's better than nothing I think.
Is it ready for merging, or does it need work?
Seems ready to me.