diff options
author | George Marques <george@gmarqu.es> | 2016-07-21 12:13:35 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2016-07-21 12:14:25 -0300 |
commit | f4c0bc20c3052533a44533dc85a0576d0ecc140d (patch) | |
tree | a816d1241ddd3ade691976439ad0d1bbad9c0a42 /platform/windows/os_windows.cpp | |
parent | 4abc945466c69426cf4c00ab87d61b927ef1639d (diff) |
Fix mouse wheel event position on Windows
Diffstat (limited to 'platform/windows/os_windows.cpp')
-rw-r--r-- | platform/windows/os_windows.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index b0a50ca4b8..dfdd71bf12 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -581,11 +581,14 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) { } } else if (mouse_mode!=MOUSE_MODE_CAPTURED) { // for reasons unknown to mankind, wheel comes in screen cordinates - RECT rect; - GetWindowRect(hWnd,&rect); - mb.x-=rect.left; - mb.y-=rect.top; + POINT coords; + coords.x = mb.x; + coords.y = mb.y; + ScreenToClient(hWnd, &coords); + + mb.x = coords.x; + mb.y = coords.y; } if (main_loop) { |