-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(cdk/overlay): sub-pixel deviations throwing off positioning in some cases #21427
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
Conversation
743c39f
to
13c7e47
Compare
…me cases If the browser is zoomed in beyond the default level, it may report numbers with sub-pixel deviations to `getBoundingClientRect` (e.g. 100.09 vs 100) which can throw off our logic when comparing against the viewport size which is always a whole number. These changes fix the issue by rounding down the numbers that we get from `getBoundingClientRect`. Fixes angular#21350.
13c7e47
to
19b9b4c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* deviations in the `ClientRect` returned by the browser (e.g. when zoomed in with a percentage | ||
* size, see #21350). | ||
*/ | ||
function getRoundedBoundingClientRect(clientRect: ClientRect): ClientRect { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It just rolls right off the tongue
…me cases (#21427) If the browser is zoomed in beyond the default level, it may report numbers with sub-pixel deviations to `getBoundingClientRect` (e.g. 100.09 vs 100) which can throw off our logic when comparing against the viewport size which is always a whole number. These changes fix the issue by rounding down the numbers that we get from `getBoundingClientRect`. Fixes #21350. (cherry picked from commit 0c8cfa7)
…me cases (#21427) If the browser is zoomed in beyond the default level, it may report numbers with sub-pixel deviations to `getBoundingClientRect` (e.g. 100.09 vs 100) which can throw off our logic when comparing against the viewport size which is always a whole number. These changes fix the issue by rounding down the numbers that we get from `getBoundingClientRect`. Fixes #21350. (cherry picked from commit 0c8cfa7)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
If the browser is zoomed in beyond the default level, it may report numbers with sub-pixel deviations to
getBoundingClientRect
(e.g. 100.09 vs 100) which can throw off our logic when comparing against the viewport size which is always a whole number.These changes fix the issue by rounding down the numbers that we get from
getBoundingClientRect
.Fixes #21350.