mirror of
https://github.com/robbert-vdh/nih-plug.git
synced 2026-07-01 02:36:54 +00:00
Fix iced param slider not snapping to values
For discrete parameters.
This commit is contained in:
@@ -200,9 +200,11 @@ impl<'a, P: Param> ParamSlider<'a, P> {
|
||||
let plain_value = self.param.preview_plain(normalized_value);
|
||||
let current_plain_value = self.param.plain_value();
|
||||
if plain_value != current_plain_value {
|
||||
// For the aforementioned snapping
|
||||
let normalized_plain_value = self.param.preview_normalized(plain_value);
|
||||
shell.publish(ParamMessage::SetParameterNormalized(
|
||||
self.param.as_ptr(),
|
||||
normalized_value,
|
||||
normalized_plain_value,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user