diff --git a/CHANGELOG.md b/CHANGELOG.md index 687c5fa9..357ee600 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ NOTE: [`epaint`](epaint/CHANGELOG.md), [`eframe`](eframe/CHANGELOG.md), [`egui_w * By default, `DragValue`:s no longer show a tooltip when hovered. Change with `Style::explanation_tooltips`. * Smaller and nicer color picker. * `ScrollArea` will auto-shrink to content size unless told otherwise using `ScollArea::auto_shrink`. +* By default, `Slider`'s `clamp_to_range` is set to true. ### Fixed 🐛 * Fix wrongly sized multiline `TextEdit` in justified layouts. diff --git a/egui/src/widgets/slider.rs b/egui/src/widgets/slider.rs index cd84682d..28996178 100644 --- a/egui/src/widgets/slider.rs +++ b/egui/src/widgets/slider.rs @@ -95,7 +95,7 @@ impl<'a> Slider<'a> { smallest_positive: 1e-6, largest_finite: f64::INFINITY, }, - clamp_to_range: false, + clamp_to_range: true, smart_aim: true, show_value: true, prefix: Default::default(), @@ -163,7 +163,7 @@ impl<'a> Slider<'a> { } /// If set to `true`, all incoming and outgoing values will be clamped to the slider range. - /// Default: `false`. + /// Default: `true`. pub fn clamp_to_range(mut self, clamp_to_range: bool) -> Self { self.clamp_to_range = clamp_to_range; self