From 640247a6754137e5201c50424362187b89bead01 Mon Sep 17 00:00:00 2001 From: Mikolaj Wielgus Date: Sat, 26 Apr 2025 03:57:16 +0200 Subject: [PATCH] fix(topola-egui): clamp timestep slider to 0.001-3.0 instead of 0.0-3.0 Timestep should never be set to 0 because this freezes the GUI if the execution takes a long time. Of course, this solution assumes that any lengthy operation is split into sufficiently fine steppable steps. Fixes https://codeberg.org/topola/topola/issues/203 --- crates/topola-egui/src/menu_bar.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/topola-egui/src/menu_bar.rs b/crates/topola-egui/src/menu_bar.rs index 0e70d09..6e9209b 100644 --- a/crates/topola-egui/src/menu_bar.rs +++ b/crates/topola-egui/src/menu_bar.rs @@ -109,7 +109,7 @@ impl MenuBar { ui.label(tr.text("tr-menu-view-frame-timestep")); ui.add( - egui::widgets::Slider::new(&mut self.frame_timestep, 0.0..=3.0) + egui::widgets::Slider::new(&mut self.frame_timestep, 0.001..=3.0) .suffix(" s"), ); });