From efe90fc64fa4e98aabc0bdf131de548651f8c04b Mon Sep 17 00:00:00 2001 From: iddev5 Date: Sun, 5 Jun 2022 18:11:58 +0530 Subject: [PATCH] mach: Rename scroll -> mouse_scroll and use f32 for offsets --- src/platform/native.zig | 6 +++--- src/structs.zig | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/platform/native.zig b/src/platform/native.zig index e6fd5a33..334f8d29 100644 --- a/src/platform/native.zig +++ b/src/platform/native.zig @@ -256,9 +256,9 @@ pub const Platform = struct { fn callback(window: glfw.Window, xoffset: f64, yoffset: f64) void { const pf = (window.getUserPointer(UserPtr) orelse unreachable).platform; pf.pushEvent(.{ - .scroll = .{ - .xoffset = xoffset, - .yoffset = yoffset, + .mouse_scroll = .{ + .xoffset = @floatCast(f32, xoffset), + .yoffset = @floatCast(f32, yoffset), }, }); } diff --git a/src/structs.zig b/src/structs.zig index b364f302..32feefa8 100644 --- a/src/structs.zig +++ b/src/structs.zig @@ -62,8 +62,8 @@ pub const Event = union(enum) { mouse_release: struct { button: enums.MouseButton, }, - scroll: struct { - xoffset: f64, - yoffset: f64, + mouse_scroll: struct { + xoffset: f32, + yoffset: f32, }, };