Open tiennou opened 4 months ago
The second make the mouse cursor move properly by scaling its position with the DPI, but that makes the buttons active area all wrong, and I can't see where the hit-testing is actually happening.
The problem here is that you are not correcting the mouse-move/click/drag operations. See e.g. https://github.com/Return-To-The-Roots/s25client/blob/73acea701915e0b857482af6006cfb9342925032/extras/videoDrivers/SDL2/VideoSDL2.cpp#L401 or search this file for mouse_xy.pos =
I suspect you don't need the 2nd commit here and just can remove the getGuiScale().screenToView
from VideoSDL2, but haven't fully checked that. It just looks like you basically undo the scaling by screenToView
with * dpiScale
which sounds like the scaling is wrong in the first place.
The bug is described in #1621, and is about the game using only the bottom-left corner of the window to draw, and the mouse cursor bounding box not being correct (so you can't access Settings > Graphics, as it gets clamped by the bottom of the screen).
The first commit fixes the rendering to be full-screen again, but the mouse cursor is still "locked" into the top-left corner (but the buttons work). The second make the mouse cursor move properly by scaling its position with the DPI, but that makes the buttons active area all wrong, and I can't see where the hit-testing is actually happening.