From 3c3dd1d57021b8a1fae642b840f064b6175ec971 Mon Sep 17 00:00:00 2001 From: Aaron Rey-Hezzat Date: Mon, 23 Feb 2026 08:22:54 +0100 Subject: [PATCH] Implement zoom_step() and set_zoom_step() to PanZoomCamera2d camera. --- src/camera/sidescroll2d.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/camera/sidescroll2d.rs b/src/camera/sidescroll2d.rs index daf3054f3..a06ce17e5 100644 --- a/src/camera/sidescroll2d.rs +++ b/src/camera/sidescroll2d.rs @@ -73,6 +73,16 @@ impl PanZoomCamera2d { self.update_projviews(); } + /// Gets the zoom step of the camera. + pub fn zoom_step(&self) -> f32 { + self.zoom_step + } + + /// Sets the zoom step of the camera. + pub fn set_zoom_step(&mut self, new_zoom_step: f32) { + self.zoom_step = new_zoom_step; + } + /// Move the camera such that it is centered on a specific point. pub fn look_at(&mut self, at: Vec2, zoom: f32) { self.at = at;