-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make scroll-to-zoom a lot more responsive in 3D views #4668
Conversation
self.unprocessed_scroll_delta += raw_scroll_delta; | ||
|
||
let dt = response.ctx.input(|i| i.stable_dt).at_most(0.1); | ||
let t = egui::emath::exponential_smooth_factor(0.90, 0.1, dt); // reach _% in _ seconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really happy with the exponential_smooth_factor
function ❤️
https://docs.rs/emath/latest/emath/fn.exponential_smooth_factor.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tried on Mac @ web with touchpad, mouse wheel stepped, mouse wheel smooth (logitech stuff) and all modes feel great with this fix! <3
@AnkeAnke gave it a spin (pun intended) on Linux @ Firefox and confirmed it behaving nicely |
I still find the size of a scroll step to be unreasonably large on linux This is one wheel click forward/backward: 2024-01-04.18-34-47.mp4 |
size of scroll step hasn't changed in this PR. I suppose we need to do something more clever scene dependent and maybe clamp large scroll steps on some mouse wheels? The annoying thing is that what we get from a mouse wheel is "number of text lines to scroll up or down" |
Yeah -- it hasn't gotten worse. I'm just saying any improvements from this PR are dwarfed by the fact that it's always been terrible.
|
What
Switch from linear interpolation to exponential.
Now 90% of the scroll delta is applied within 0.1 seconds. This is long enough to feel smooth, but short enough to feel responsive.
This feels great on my Mac
Checklist
main
build: app.rerun.ionightly
build: app.rerun.io