1
0
Fork 0

Always fill stepped parameter sliders from left

This commit is contained in:
Robbert van der Helm 2022-03-16 01:33:47 +01:00
parent aa3e6282b7
commit 1971273cb6

View file

@ -474,11 +474,11 @@ impl<'a, P: Param> Widget<ParamMessage, Renderer> for ParamSlider<'a, P> {
} else { } else {
// We'll visualize the difference between the current value and the default value // We'll visualize the difference between the current value and the default value
let current_value = self.param.normalized_value(); let current_value = self.param.normalized_value();
// For boolean values alawys have filled be true and not filled be false, otherwise it // For discrete alawys fill the bar from the left because it otherwise looks a bit
// looks super confusing // jarring when any any value after the first one is the defautl
let fill_start_x = util::remap_rect_x_t( let fill_start_x = util::remap_rect_x_t(
&bounds, &bounds,
if self.param.step_count() == Some(1) { if self.param.step_count().is_some() {
0.0 0.0
} else { } else {
self.setter.default_normalized_param_value(self.param) self.setter.default_normalized_param_value(self.param)