diff --git a/crates/egui/src/widgets/slider.rs b/crates/egui/src/widgets/slider.rs index d3c9dc94989..84e47aeef3e 100644 --- a/crates/egui/src/widgets/slider.rs +++ b/crates/egui/src/widgets/slider.rs @@ -536,13 +536,13 @@ impl<'a> Slider<'a> { let end = *self.range.end(); value = value.clamp(start.min(end), start.max(end)); } - if let Some(max_decimals) = self.max_decimals { - value = emath::round_to_decimals(value, max_decimals); - } if let Some(step) = self.step { let start = *self.range.start(); value = start + ((value - start) / step).round() * step; } + if let Some(max_decimals) = self.max_decimals { + value = emath::round_to_decimals(value, max_decimals); + } set(&mut self.get_set_value, value); }