1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-06 19:41:11 +00:00

Fix vertical scroll/zoom for precision touchpad

Adds factor data for vertical mousewheel event, in line with horizontal mousewheel event

(cherry picked from commit 63ba15a518)
This commit is contained in:
Georg Wacker
2021-08-06 15:06:11 +02:00
committed by Rémi Verschelde
parent 0142a378c6
commit 8add8f4e58

View File

@@ -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);