-
Notifications
You must be signed in to change notification settings - Fork 301
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
[Renderers/Raylib] Faulty high DPI layout and mouse position calculation after resizing #116
Comments
Interesting - just to clarify, this is raylib 5.5 on windows with high DPI? |
Yeah, sorry for not clarifying - OS is Windows 10, Raylib 5.5, 125% scaling for the main (1440p) monitor and 100% for the 1080p monitor. |
Hmm, this seems like a fundamental issue with Raylib: raysan5/raylib#4215. I tried playing around with the code and while I managed to hack together a fix for the scaling issue, I was unable to fix the mouse position issue (the mouse position seems to be erroneously scaled on the second monitor based on the first monitor's scaling, so definitely some very weird and unintended stuff from Raylib's side). In the mentioned issue, OP says that the HIGH DPI flag does more harm than good and is broken in many use cases. Thus, one approach would be to add High DPI support in Clay directly, which could simply be a factor scaling the elements and text (the user would have to handle font re-rendering on DPI change manually, but that should be possible with Raylib's GetWindowScaleDPI()). |
…tion after resizing nicbarker#116
Layout calculations seem incorrect on my 1440p monitor with FLAG_WINDOW_HIGHDPI.
This is my monitor layout:
Running the "raylib-sidebar-scrolling-container" example, the layout initially looks normal:
After resizing, the content is sized larger than the window (this remains true until restarting the program) [mouse cursor calculations are still correct]:
When pulling the window over to my 1080p monitor, the mouse cursor is offset (see how the mouse cursor is to the right of the element clay/raylib thinks is selected):
The text was updated successfully, but these errors were encountered: