Skip to content

Commit

Permalink
fix(mandelbrot): remove time hack for web_time
Browse files Browse the repository at this point in the history
  • Loading branch information
boralg committed Feb 18, 2025
1 parent 0de1ca6 commit f47d5cb
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions examples/src/mandelbrot/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ impl AppState for MandelbrotState {
aspect_ratio,
_padding: [0.0; 2],
},
scale_speed: 1.0 - 0.001,
scale_speed: 0.5f32,
last_cursor_location: PhysicalPosition::new(0.0, 0.0),
cursor_location: PhysicalPosition::new(0.0, 0.0),
last_timestep: now_secs(),
Expand All @@ -171,11 +171,6 @@ impl AppState for MandelbrotState {
let mut dt = 0f32;
dt += now_secs() - self.last_timestep;

#[cfg(target_arch = "wasm32")]
{
dt *= -1000f32; // hack
}

dt
};

Expand Down Expand Up @@ -203,10 +198,10 @@ impl AppState for MandelbrotState {

match self.interaction_state {
InteractionState::ZoomingIn => {
self.uniforms.scale *= self.scale_speed.powf(1f32 - dt as f32);
self.uniforms.scale *= self.scale_speed.powf(dt);
}
InteractionState::ZoomingOut => {
self.uniforms.scale /= self.scale_speed.powf(1f32 - dt as f32);
self.uniforms.scale /= self.scale_speed.powf(dt);
}
_ => (),
}
Expand Down

0 comments on commit f47d5cb

Please sign in to comment.