From 882ba8f61db6510e37fd87c4ac87e53675e6ac9d Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 9 Feb 2022 11:36:10 +0100 Subject: [PATCH] Don't use smart aim Probably not needed here --- nih_plug_egui/src/widgets/param_slider.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/nih_plug_egui/src/widgets/param_slider.rs b/nih_plug_egui/src/widgets/param_slider.rs index 713eae30..570c6f77 100644 --- a/nih_plug_egui/src/widgets/param_slider.rs +++ b/nih_plug_egui/src/widgets/param_slider.rs @@ -74,20 +74,8 @@ impl Widget for ParamSlider<'_, P> { self.begin_drag(); } if let Some(click_pos) = response.interact_pointer_pos() { - let aim_radius = ui.input().aim_radius(); - let proportion = egui::emath::smart_aim::best_in_range_f64( - egui::emath::remap_clamp( - click_pos.x - aim_radius, - response.rect.x_range(), - 0.0..=1.0, - ) as f64, - egui::emath::remap_clamp( - click_pos.x + aim_radius, - response.rect.x_range(), - 0.0..=1.0, - ) as f64, - ); - + let proportion = + egui::emath::remap_clamp(click_pos.x, response.rect.x_range(), 0.0..=1.0) as f64; self.set_normalized_value(proportion as f32); } if response.drag_released() {