From b56f7781f1dea5452581f38b07973e6a950ce77d Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 23 May 2024 15:20:48 +0200 Subject: [PATCH] Smooth scrolling in 2D space views When scrolling with a discreet mouse wheel, the scrolling is now smoothed. --- crates/re_space_view_spatial/src/ui_2d.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/crates/re_space_view_spatial/src/ui_2d.rs b/crates/re_space_view_spatial/src/ui_2d.rs index e406167b3e1a..3a24f7444bf8 100644 --- a/crates/re_space_view_spatial/src/ui_2d.rs +++ b/crates/re_space_view_spatial/src/ui_2d.rs @@ -80,12 +80,7 @@ fn ui_from_scene( let mut pan_delta_in_ui = response.drag_delta(); if response.hovered() { - // NOTE: we use `raw_scroll` instead of `smooth_scroll_delta` to avoid the - // added latency of smoothing, which is really annoying on Mac trackpads. - // The smoothing is only useful for users with discreet scroll wheels, - // and they are likely to pan with dragging instead. - // TODO(egui#4401): https://github.com/emilk/egui/issues/4401 - pan_delta_in_ui += response.ctx.input(|i| i.raw_scroll_delta); + pan_delta_in_ui += response.ctx.input(|i| i.smooth_scroll_delta); } if pan_delta_in_ui != Vec2::ZERO { *visual_bounds =