correctly update mouse delta

This commit is contained in:
Alessandro Mauri 2025-12-04 19:43:41 +01:00
parent 0c08a42f8c
commit c04f63f7be

View File

@ -276,7 +276,9 @@ fn void? Ctx.frame_end(&ctx)
} }
// 2. clear input fields // 2. clear input fields
Point mdelta = ctx.current_input.mouse.pos - ctx.input.mouse.pos;
ctx.input = ctx.current_input; ctx.input = ctx.current_input;
ctx.input.mouse.delta = mdelta;
ctx.current_input.events = {}; ctx.current_input.events = {};
ctx.current_input.mouse.scroll = {}; ctx.current_input.mouse.scroll = {};
ctx.current_input.mouse.updated = BTN_NONE; ctx.current_input.mouse.updated = BTN_NONE;