kill velocity after overscroll (#126)
This commit is contained in:
parent
d77fd9e3dc
commit
577aa2699f
1 changed files with 5 additions and 0 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue