1
0
Fork 0

Simplify param button checked state

This commit is contained in:
Robbert van der Helm 2022-11-04 16:12:15 +01:00
parent aee08bae20
commit 52130373a3

View file

@ -48,9 +48,7 @@ impl ParamButton {
.build(cx, move |cx| {
Label::new(cx, &param_name);
})
.bind(param_value_lens, |cx, value| {
cx.checked(value.map(|v| v >= &0.5));
})
.checked(param_value_lens.map(|v| v >= &0.5))
}
/// Set the parameter's normalized value to either 0.0 or 1.0 depending on its current value.