diff --git a/crates/egui/src/widgets/slider.rs b/crates/egui/src/widgets/slider.rs index 182019b95dc..07c4f410a2d 100644 --- a/crates/egui/src/widgets/slider.rs +++ b/crates/egui/src/widgets/slider.rs @@ -508,7 +508,8 @@ impl<'a> Slider<'a> { value = emath::round_to_decimals(value, max_decimals); } if let Some(step) = self.step { - value = (value / step).round() * step; + let start = *self.range.start(); + value = start + ((value - start) / step).round() * step; } set(&mut self.get_set_value, value); }