Closed hmkemppainen closed 1 year ago
I could swear this was fixed...
Maybe I only fixed it in Augustus? I'll test.
Indeed, there seems to be a fix in Augustus.
https://github.com/Keriew/augustus/commit/6bec6110ee1794d39024c40f5e8442951e0d1aaf
Thanks for looking that up! I have cherry-picked the commit to Julius.
Steps to reproduce:
0) Launch Julius (latest master or latest release) 1) Go to options and set display scale to 200% 2) Start a new game, and scroll by right click and drag in the world
What happens is that when you lift the mouse button, the cursor warps towards the bottom/right and may initiate an edge scroll, depending on where the cursor initially was when you pressed RMB down.
This is caused by
system_mouse_set_relative_mode()
retrieving unscaled coordinates from SDL and later passing them tosystem_set_mouse_position()
, which scales the coordinates.Since the goal here is to just store and restore cursor position before & after drag, I'd propose just using
SDL_GetGlobalMouseState()
andSDL_WarpMouseGlobal()
and avoiding the scaling wrapper entirely. However, I'm not sure global warp is supported on all relevant platforms..