Commit eeaa7cd
committed
fix(android): use window display metrics for dp <-> px conversion in PixelUtil
PixelUtil is the dp <-> px conversion the layout engine uses. Reading
the screen display metrics returns the primary display's density, which
is incorrect when the activity is on a secondary display (Samsung DeX,
desktop windowing, virtual displays via am start --display N). The
resulting density mismatch makes Fabric lay out content at the wrong
scale, leaving the visible region clipped to a fraction of the activity
window and rendering text at sub-pixel positions.
Reverts the four call sites changed in #53523 back to
getWindowDisplayMetrics, restoring 0.81 behaviour on secondary displays.
Single-display behaviour is unchanged because window and screen metrics
match in that case.
Fixes #56894 (relates to #55659).
Changelog: [ANDROID] [FIXED] - Use window display metrics in PixelUtil so layout scales correctly on secondary displays / desktop mode / freeform windows.1 parent f5bd86c commit eeaa7cd
1 file changed
Lines changed: 4 additions & 4 deletions
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
0 commit comments