mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-06 05:48:40 +00: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);
|
S16 wheel_delta = HIWORD(wParam);
|
||||||
OS_Event *event = w32_push_event(OS_EventKind_Scroll, window);
|
OS_Event *event = w32_push_event(OS_EventKind_Scroll, window);
|
||||||
event->pos.x = (F32)LOWORD(lParam);
|
POINT p;
|
||||||
event->pos.y = (F32)HIWORD(lParam);
|
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);
|
event->delta = v2f32(0.f, -(F32)wheel_delta);
|
||||||
}break;
|
}break;
|
||||||
|
|
||||||
@@ -449,8 +453,12 @@ w32_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
{
|
{
|
||||||
S16 wheel_delta = HIWORD(wParam);
|
S16 wheel_delta = HIWORD(wParam);
|
||||||
OS_Event *event = w32_push_event(OS_EventKind_Scroll, window);
|
OS_Event *event = w32_push_event(OS_EventKind_Scroll, window);
|
||||||
event->pos.x = (F32)LOWORD(lParam);
|
POINT p;
|
||||||
event->pos.y = (F32)HIWORD(lParam);
|
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);
|
event->delta = v2f32((F32)wheel_delta, 0.f);
|
||||||
}break;
|
}break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user