Fix MouseWheel position on Windows
This commit is contained in:
parent
734045667d
commit
7174d706aa
1 changed files with 4 additions and 5 deletions
|
@ -511,8 +511,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
if (motion < 0) {
|
if (motion < 0) {
|
||||||
mb.button_index = BUTTON_WHEEL_LEFT;
|
mb.button_index = BUTTON_WHEEL_LEFT;
|
||||||
mb.factor = fabs((double)motion / (double)WHEEL_DELTA);
|
mb.factor = fabs((double)motion / (double)WHEEL_DELTA);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
mb.button_index = BUTTON_WHEEL_RIGHT;
|
mb.button_index = BUTTON_WHEEL_RIGHT;
|
||||||
mb.factor = fabs((double)motion / (double)WHEEL_DELTA);
|
mb.factor = fabs((double)motion / (double)WHEEL_DELTA);
|
||||||
}
|
}
|
||||||
|
@ -550,9 +549,6 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
mb.y = old_y;
|
mb.y = old_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
mb.global_x = mb.x;
|
|
||||||
mb.global_y = mb.y;
|
|
||||||
|
|
||||||
if (uMsg != WM_MOUSEWHEEL) {
|
if (uMsg != WM_MOUSEWHEEL) {
|
||||||
if (mb.pressed) {
|
if (mb.pressed) {
|
||||||
|
|
||||||
|
@ -577,6 +573,9 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
mb.y = coords.y;
|
mb.y = coords.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mb.global_x = mb.x;
|
||||||
|
mb.global_y = mb.y;
|
||||||
|
|
||||||
if (main_loop) {
|
if (main_loop) {
|
||||||
input->parse_input_event(event);
|
input->parse_input_event(event);
|
||||||
if (mb.pressed && mb.button_index > 3) {
|
if (mb.pressed && mb.button_index > 3) {
|
||||||
|
|
Loading…
Reference in a new issue