Skip to content

Commit

Permalink
fix scroll Mandelbrot zooming speed
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitmel committed Jun 19, 2021
1 parent 8c445bf commit 5d2efd3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mandelbrot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::globals::SharedGlobals;
use crate::input::Key;
use crate::renderer;

const CAMERA_ZOOM_SPEED: f64 = 0.04;
const CAMERA_ZOOM_SPEED: f64 = 2.4;
const CAMERA_UPDATE_COOLDOWN: f64 = 1.0;
const MAX_PIXELATION_LEVEL: u32 = 4;
const UNIT_SIZE: Vec2f64 = vec2n(200.0);
Expand Down Expand Up @@ -144,7 +144,7 @@ impl Mandelbrot {

let zoom_axis = self.globals.input_state.axis(Key::Minus, Key::Equals);
if zoom_axis != 0 {
let zoom_factor = 1.0 + zoom_axis as f64 * CAMERA_ZOOM_SPEED;
let zoom_factor = 1.0 + zoom_axis as f64 * self.globals.delta_time * CAMERA_ZOOM_SPEED;
self.camera_zoom *= zoom_factor;
// <https://stackoverflow.com/a/2919434/12005228>
self.camera_pos -=
Expand Down

0 comments on commit 5d2efd3

Please sign in to comment.