From f4c0bc20c3052533a44533dc85a0576d0ecc140d Mon Sep 17 00:00:00 2001 From: George Marques Date: Thu, 21 Jul 2016 12:13:35 -0300 Subject: Fix mouse wheel event position on Windows --- platform/windows/os_windows.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'platform/windows/os_windows.cpp') 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) { -- cgit v1.2.3