From 8add8f4e588dc6f37264b52b2e2ef2a6f86d8895 Mon Sep 17 00:00:00 2001 From: Georg Wacker Date: Fri, 6 Aug 2021 15:06:11 +0200 Subject: [PATCH] Fix vertical scroll/zoom for precision touchpad Adds factor data for vertical mousewheel event, in line with horizontal mousewheel event (cherry picked from commit 63ba15a51837e317bc4b150d69e8928cff13b9e0) --- platform/windows/os_windows.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index ec4db7ed053..72a37f454e6 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -895,11 +895,12 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if (!motion) return 0; - if (motion > 0) + if (motion > 0) { mb->set_button_index(BUTTON_WHEEL_UP); - else + } else { mb->set_button_index(BUTTON_WHEEL_DOWN); - + } + mb->set_factor(fabs((double)motion / (double)WHEEL_DELTA)); } break; case WM_MOUSEHWHEEL: { mb->set_pressed(true); @@ -909,11 +910,10 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if (motion < 0) { mb->set_button_index(BUTTON_WHEEL_LEFT); - mb->set_factor(fabs((double)motion / (double)WHEEL_DELTA)); } else { mb->set_button_index(BUTTON_WHEEL_RIGHT); - mb->set_factor(fabs((double)motion / (double)WHEEL_DELTA)); } + mb->set_factor(fabs((double)motion / (double)WHEEL_DELTA)); } break; case WM_XBUTTONDOWN: { mb->set_pressed(true);