mirror of
https://github.com/emilk/egui.git
synced 2026-06-27 15:13:12 -04:00
kill velocity after overscroll (#126)
This commit is contained in:
@@ -307,8 +307,13 @@ impl Prepared {
|
||||
state.scroll_start_offset_from_top = None;
|
||||
}
|
||||
|
||||
let unbounded_offset_y = state.offset.y;
|
||||
state.offset.y = state.offset.y.max(0.0);
|
||||
state.offset.y = state.offset.y.min(max_offset);
|
||||
#[allow(clippy::float_cmp)]
|
||||
if state.offset.y != unbounded_offset_y {
|
||||
state.vel = Vec2::zero();
|
||||
}
|
||||
|
||||
// Avoid frame-delay by calculating a new handle rect:
|
||||
let mut handle_rect = Rect::from_min_max(
|
||||
|
||||
Reference in New Issue
Block a user