mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-19 10:32:23 -07:00
wm_mousewheel and wm_mousehwheel report mouse coordinates in screen space, not client space; fix to account fo rthat
This commit is contained in:
@@ -440,8 +440,12 @@ w32_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
S16 wheel_delta = HIWORD(wParam);
|
||||
OS_Event *event = w32_push_event(OS_EventKind_Scroll, window);
|
||||
event->pos.x = (F32)LOWORD(lParam);
|
||||
event->pos.y = (F32)HIWORD(lParam);
|
||||
POINT p;
|
||||
p.x = (S32)LOWORD(lParam);
|
||||
p.y = (S32)HIWORD(lParam);
|
||||
ScreenToClient(window->hwnd, &p);
|
||||
event->pos.x = (F32)p.x;
|
||||
event->pos.y = (F32)p.y;
|
||||
event->delta = v2f32(0.f, -(F32)wheel_delta);
|
||||
}break;
|
||||
|
||||
@@ -449,8 +453,12 @@ w32_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
S16 wheel_delta = HIWORD(wParam);
|
||||
OS_Event *event = w32_push_event(OS_EventKind_Scroll, window);
|
||||
event->pos.x = (F32)LOWORD(lParam);
|
||||
event->pos.y = (F32)HIWORD(lParam);
|
||||
POINT p;
|
||||
p.x = (S32)LOWORD(lParam);
|
||||
p.y = (S32)HIWORD(lParam);
|
||||
ScreenToClient(window->hwnd, &p);
|
||||
event->pos.x = (F32)p.x;
|
||||
event->pos.y = (F32)p.y;
|
||||
event->delta = v2f32((F32)wheel_delta, 0.f);
|
||||
}break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user