Incorrect extraction of the mouse Y coordinate for mouse move
codri opened this issue · 1 comments
codri commented
On line:
https://github.com/google/xi-win/blob/master/xi-win-shell/src/window.rs#L495
I believe that should be:
let y = HIWORD(lparam as u32) as i16 as i32;
Also, in Microsoft docs the suggested way to get the X and Y coordinates is using these macros(https://docs.microsoft.com/en-us/windows/desktop/inputdev/wm-mousemove#remarks).
It seems to be implemented in winapi-rs(https://retep998.github.io/doc/winapi/windowsx/fn.GET_X_LPARAM.html), but looking at the implementation it doesn't differ much from the current approach, seems to work though.
raphlinus commented
Indeed.
Using the macros would probably be better, but I did the simple fix for now. Thanks!