From 1971273cb618eca48844528d5213e43712967e87 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 16 Mar 2022 01:33:47 +0100 Subject: [PATCH] Always fill stepped parameter sliders from left --- nih_plug_iced/src/widgets/param_slider.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nih_plug_iced/src/widgets/param_slider.rs b/nih_plug_iced/src/widgets/param_slider.rs index a5dd76c9..c60594da 100644 --- a/nih_plug_iced/src/widgets/param_slider.rs +++ b/nih_plug_iced/src/widgets/param_slider.rs @@ -474,11 +474,11 @@ impl<'a, P: Param> Widget for ParamSlider<'a, P> { } else { // We'll visualize the difference between the current value and the default value let current_value = self.param.normalized_value(); - // For boolean values alawys have filled be true and not filled be false, otherwise it - // looks super confusing + // For discrete alawys fill the bar from the left because it otherwise looks a bit + // jarring when any any value after the first one is the defautl let fill_start_x = util::remap_rect_x_t( &bounds, - if self.param.step_count() == Some(1) { + if self.param.step_count().is_some() { 0.0 } else { self.setter.default_normalized_param_value(self.param)