summaryrefslogtreecommitdiff
path: root/pugl/pugl_win.cpp
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-11-16 17:27:46 +0100
committerDavid Robillard <d@drobilla.net>2014-12-16 18:31:22 -0500
commit3fa6c2c10f7d4ca06fd30e2442dcd25f492cc351 (patch)
tree39bc8c53d1e82ec53cbaf3e20b0a2776edcd6be1 /pugl/pugl_win.cpp
parent0cf9eb2f0fd8afd9b58060e3cb064fa5836f66f1 (diff)
Fix windows scroll wheel.
Conflicts: pugl/pugl_win.cpp
Diffstat (limited to 'pugl/pugl_win.cpp')
-rw-r--r--pugl/pugl_win.cpp12
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: