[win32] Scale up bounds as rectangle in canvas #1761
Merged
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.
This PR addresses render artifacts visible in StyledText with monitor-specific scaling enabled e.g. on 175% with quarter scaling mode. Reason is that scaling up all attributes of bounds separately can lead to rounding errors e.g. between y and height (one being scaled up, the other one not). Scaling them together as a rectangle solves this limitation.
Before
Black lines appear, because for each four lines the y is scaled up (e.g. from 50.5 to 51), but the height was not scaled up (25.25 is always 25) -> one pixel is skipped each four lines when drawing the background
After
The effect is usually only visible if multiple connecting background chunks are drawn, but the wrong values would be produced in all scenarios.
The same issue is probably hidden in other places as well, e.g. in GC when something should be scaled as rectangle but is scaled independently. We will try to find use cases and fix them one by one.