You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Raylib's current mouse position is only updated on mouse events. Hence, if the window position is changed (using SetWindowPosition) without mouse movement occurring, then the current mouse position is not adjusted. The values reported by GetMousePosition and GetMouseDelta are incorrect afterwards, until the mouse is moved again.
This was a bit of a headache for a little windowed GUI I implemented.
Since there is no way to directly query the absolute mouse position either, my only workaround was to maintain mirrors of mouse position, delta, and the previous window position. On each frame check for a change in window position co-occurring with a zero mouse delta, and in that case, correct the mirror mouse position and delta by the window movement delta. That seems to work, but of course, it would be preferable if that wasn't necessary.
Environment
Running on MacOS. But deducing from a glance at the Raylib sources, I expect this to occur on other platforms as well.
The text was updated successfully, but these errors were encountered:
Issue description
Raylib's current mouse position is only updated on mouse events. Hence, if the window position is changed (using SetWindowPosition) without mouse movement occurring, then the current mouse position is not adjusted. The values reported by GetMousePosition and GetMouseDelta are incorrect afterwards, until the mouse is moved again.
This was a bit of a headache for a little windowed GUI I implemented.
Since there is no way to directly query the absolute mouse position either, my only workaround was to maintain mirrors of mouse position, delta, and the previous window position. On each frame check for a change in window position co-occurring with a zero mouse delta, and in that case, correct the mirror mouse position and delta by the window movement delta. That seems to work, but of course, it would be preferable if that wasn't necessary.
Environment
Running on MacOS. But deducing from a glance at the Raylib sources, I expect this to occur on other platforms as well.
The text was updated successfully, but these errors were encountered: