1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-28 07:23:13 -04:00

Smooth scrolling (#3884)

This adds smooth scrolling in egui. This makes scrolling in a
`ScrollArea` using a notched mouse wheel a lot nicer.

`InputState::scroll_delta` has been replaced by
`InputState::raw_scroll_delta` and `InputState::smooth_scroll_delta`.
This commit is contained in:
Emil Ernerfeldt
2024-01-24 16:40:20 +01:00
committed by GitHub
parent 200051d5d8
commit 5388e65623
5 changed files with 77 additions and 27 deletions

View File

@@ -1115,7 +1115,7 @@ impl Plot {
}
}
if allow_scroll {
let scroll_delta = ui.input(|i| i.scroll_delta);
let scroll_delta = ui.input(|i| i.smooth_scroll_delta);
if scroll_delta != Vec2::ZERO {
transform.translate_bounds(-scroll_delta);
auto_bounds = false.into();