Fix scaling anchors in PMv2 applications. - #8349
Merged
Merged
Conversation
Fixes #8266. In PermonV2 mode applications, when moved from one monitor to the other, Form/Container is scaled with scale factor computed with respect to new DPI on the monitor. However, scaling ratio between non-cleant and client area is not linear. This is causing few pixel variance when anchors are also scaled with same scale factor. Anchors are relative to display rectangle. Hence, computing anchor scale factor with repsect to chnage in Display rect instead of chnage in the bounds (a.k.a: scale factor computed with respect to new DPI).
Tanya-Solyanik
left a comment
Contributor
There was a problem hiding this comment.
Looks good, it is possible to add tests?
lonitra
reviewed
Dec 9, 2022
Member
Author
We have tests for anchors not just display rectangle. I will look if we need any specific test for the display rect cached but not in this PR> |
dreddy-work
enabled auto-merge (squash)
December 12, 2022 21:17
Tanya-Solyanik
left a comment
Contributor
There was a problem hiding this comment.
Looks good. I added some nit picks.
Member
Author
|
related #8442 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #8266.
In PermonV2 mode applications, when moved from one monitor to the other, Form/Container is scaled with scale factor computed with respect to new DPI on the monitor. However, scaling ratio between non-client and client area is not linear. This is causing few pixels variance when anchors are also scaled with same scale factor.
Anchors are relative to display rectangle. Hence, making change to computing anchor scale factor with respect to change in DisplayRect instead of change in the bounds (a.k.a: scale factor computed with respect to new DPI).
This PR follows #8201.
Microsoft Reviewers: Open in CodeFlow