1
0
Fork 0

Don't use smart aim

Probably not needed here
This commit is contained in:
Robbert van der Helm 2022-02-09 11:36:10 +01:00
parent 8e7a86262f
commit 882ba8f61d

View file

@ -74,20 +74,8 @@ impl<P: Param> Widget for ParamSlider<'_, P> {
self.begin_drag(); self.begin_drag();
} }
if let Some(click_pos) = response.interact_pointer_pos() { if let Some(click_pos) = response.interact_pointer_pos() {
let aim_radius = ui.input().aim_radius(); let proportion =
let proportion = egui::emath::smart_aim::best_in_range_f64( egui::emath::remap_clamp(click_pos.x, 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,
egui::emath::remap_clamp(
click_pos.x + aim_radius,
response.rect.x_range(),
0.0..=1.0,
) as f64,
);
self.set_normalized_value(proportion as f32); self.set_normalized_value(proportion as f32);
} }
if response.drag_released() { if response.drag_released() {