Fix mouse wheel event position on Windows

This commit is contained in:
George Marques 2016-07-21 12:13:35 -03:00
parent 4abc945466
commit f4c0bc20c3
No known key found for this signature in database
GPG Key ID: 046BD46A3201E43D

View File

@ -581,11 +581,14 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) {
} }
} else if (mouse_mode!=MOUSE_MODE_CAPTURED) { } else if (mouse_mode!=MOUSE_MODE_CAPTURED) {
// for reasons unknown to mankind, wheel comes in screen cordinates // for reasons unknown to mankind, wheel comes in screen cordinates
RECT rect; POINT coords;
GetWindowRect(hWnd,&rect); coords.x = mb.x;
mb.x-=rect.left; coords.y = mb.y;
mb.y-=rect.top;
ScreenToClient(hWnd, &coords);
mb.x = coords.x;
mb.y = coords.y;
} }
if (main_loop) { if (main_loop) {