diff options
author | Robin Gareus <robin@gareus.org> | 2014-11-16 17:27:46 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-12-16 18:31:22 -0500 |
commit | 3fa6c2c10f7d4ca06fd30e2442dcd25f492cc351 (patch) | |
tree | 39bc8c53d1e82ec53cbaf3e20b0a2776edcd6be1 /pugl | |
parent | 0cf9eb2f0fd8afd9b58060e3cb064fa5836f66f1 (diff) | |
download | pugl-3fa6c2c10f7d4ca06fd30e2442dcd25f492cc351.tar.gz pugl-3fa6c2c10f7d4ca06fd30e2442dcd25f492cc351.tar.bz2 pugl-3fa6c2c10f7d4ca06fd30e2442dcd25f492cc351.zip |
Fix windows scroll wheel.
Conflicts:
pugl/pugl_win.cpp
Diffstat (limited to 'pugl')
-rw-r--r-- | pugl/pugl_win.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/pugl/pugl_win.cpp b/pugl/pugl_win.cpp index 5956fdd..ead0236 100644 --- a/pugl/pugl_win.cpp +++ b/pugl/pugl_win.cpp @@ -348,18 +348,22 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam) break; case WM_MOUSEWHEEL: if (view->scrollFunc) { + POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; + ScreenToClient(view->impl->hwnd, &pt); view->event_timestamp_ms = GetMessageTime(); view->scrollFunc( - view, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), - 0.0f, (int16_t)HIWORD(wParam) / (float)WHEEL_DELTA); + view, pt.x, pt.y, + 0.0f, GET_WHEEL_DELTA_WPARAM(wParam) / (float)WHEEL_DELTA); } break; case WM_MOUSEHWHEEL: if (view->scrollFunc) { + POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; + ScreenToClient(view->impl->hwnd, &pt); view->event_timestamp_ms = GetMessageTime(); view->scrollFunc( - view, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), - (int16_t)HIWORD(wParam) / float(WHEEL_DELTA), 0.0f); + view, pt.x, pt.y, + GET_WHEEL_DELTA_WPARAM(wParam) / (float)WHEEL_DELTA, 0.0f); } break; case WM_KEYDOWN: |