-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Incorrect mouse event position y precision in maximized window with content_scale_factor #94780
Comments
Hello, new contributor here! I've looked into this for a bit, I was able to also reproduce this on Linux (Ubuntu 23.10), it seems like the issue is not actually due to full-screen, but it is due to uneven screen resolutions. Whenever the size of the window is changed, Once this size is computed, the window sets it on the I would be happy to work on a fix if I can get some guidance on what the expected behavior is. At the moment, I can see two ways it could go:
|
That's great to hear! I assume you mean uneven viewport sizes? In my case the issue only manifested in maximized windows mode. But this could I guess result in an uneven height viewport area of the window in case the height of the windows title bar is uneven (which is a little unexpected)? And it could be that in windowed mode the size will never be uneven since when resizing it at 2x scale each pixel resize step will always result in an even window size. If it's just a precision error of Vector2 I'd however expect that to result in additional decimals, but more like 128.000076 instead of things like 128.8772. But perhaps the precision error are compounded by multiple multiplications? Regarding the transforms I think they will need to at least support non-integer scales as the |
Indeed. Why is this even done? As |
This may be tangentially related to #93796 |
Tested versions
Reproducible in 4.3bX and 4.3rc1
System information
Windows 10, macOS 14.5
Issue description
In a Window with content_scale_factor 2 (for HiDPI purposes) mouse event positions are expected to be even or half pixel units, which is also the case if the window is in windowed mode or fullscreen.
However, if you instead maximize the window the y coordinate of mouse events global_position start getting additional seemingly random decimals added as you can see in the example below.
windows_precision_bug.mp4
This happen on Windows, but only in Maximized window mode. It might also happen on linux in the same mode, but I've been unable to test it myself. Can't reproduce it on macOS, but this might be because there's no maximized window mode in the same sense there.
Steps to reproduce
Minimal reproduction project (MRP)
mouse-precision-test.zip
The text was updated successfully, but these errors were encountered: