From 58ce65febe80df339595ddbe902946ecb874a2be Mon Sep 17 00:00:00 2001 From: foxnne Date: Thu, 12 Dec 2024 09:56:07 -0600 Subject: [PATCH] fine tune pinch to zoom sensitivity --- src/Pixi.zig | 1 - src/gfx/camera.zig | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Pixi.zig b/src/Pixi.zig index 5fd0b46..34fe581 100644 --- a/src/Pixi.zig +++ b/src/Pixi.zig @@ -311,7 +311,6 @@ pub fn tick(app: *App, core: *Core) !void { }, .magnify => |magnify| { state.mouse.magnify = magnify.magnification; - std.log.debug("magnify!", .{}); }, .mouse_motion => |mouse_motion| { state.mouse.position = .{ @floatCast(mouse_motion.pos.x * content_scale[0]), @floatCast(mouse_motion.pos.y * content_scale[1]) }; diff --git a/src/gfx/camera.zig b/src/gfx/camera.zig index 1ca9eee..b741f16 100644 --- a/src/gfx/camera.zig +++ b/src/gfx/camera.zig @@ -677,7 +677,7 @@ pub const Camera = struct { const nearest_zoom_index = camera.nearestZoomIndex(); const t = @as(f32, @floatFromInt(nearest_zoom_index)) / @as(f32, @floatFromInt(pixi.state.settings.zoom_steps.len - 1)); - const sensitivity = pixi.math.lerp(pixi.state.settings.zoom_min_sensitivity * 10, pixi.state.settings.zoom_max_sensitivity * 10, t) * (pixi.state.settings.zoom_sensitivity / 100.0); + const sensitivity = pixi.math.lerp(pixi.state.settings.zoom_min_sensitivity, pixi.state.settings.zoom_max_sensitivity * 80, t) * (pixi.state.settings.zoom_sensitivity / 100.0); const zoom_delta = magnification * sensitivity; camera.zoom += zoom_delta;