From 48420021365a169452acc2a6685db9ab7800f808 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Mon, 20 Jan 2025 19:55:18 +0100 Subject: [PATCH] fix(win32 gui): translate mouse wheel events from screen to window coordinates --- src/win32/gui.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/win32/gui.zig b/src/win32/gui.zig index a2a7451..2faa947 100644 --- a/src/win32/gui.zig +++ b/src/win32/gui.zig @@ -699,7 +699,8 @@ fn sendMouseWheel( ) void { const frame = tracy.initZone(@src(), .{ .name = "gui sendMouseWheel" }); defer frame.deinit(); - const point = win32ext.pointFromLparam(lparam); + var point = win32ext.pointFromLparam(lparam); + _ = win32.ScreenToClient(hwnd, &point); const state = stateFromHwnd(hwnd); const dpi = win32.dpiFromHwnd(hwnd); const cell_size = getFont(dpi, getFontSize(), getFontFace()).getCellSize(i32);