Commit 1f6ea6f
Fix 2D GUI jitter on high DPI screens (#17461)
On high DPI screens, we can see fractional pixels in the logical (CSS)
pixel space. For example, consider a 150x150 pixel screen at 150%
scaling - the logical pixel space will be 100x100. Note that pointer
events happen at the granularity of the physical display, but the
position is in the logical space, so the mouse moves by 2/3 of a unit at
a time. If we continue truncating fractional values, we lose information
which leads to intermittent off-by-one issues and jitter.
In this playground, you can see the jitter when dragging from a point on
the screen up and left before the fix, with no jitter after the fix:
https://playground.babylonjs.com/#9V23FW#3
---------
Co-authored-by: AmoebaChant <kevbrown@microsoft.com>1 parent e10ee9b commit 1f6ea6f
1 file changed
+0
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1974 | 1974 | | |
1975 | 1975 | | |
1976 | 1976 | | |
1977 | | - | |
1978 | | - | |
1979 | | - | |
1980 | | - | |
1981 | | - | |
1982 | | - | |
1983 | 1977 | | |
1984 | 1978 | | |
1985 | 1979 | | |
| |||
0 commit comments