Fix panic when scrolling non-overflowing lists
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
co-authored by
Max Brunsfeld
parent
a79b32cfc2
commit
3ac489a8b6
@@ -234,8 +234,9 @@ impl StateInner {
|
||||
todo!("still need to handle non-precise scroll events from a mouse wheel");
|
||||
}
|
||||
|
||||
let scroll_max = self.heights.summary().height - height;
|
||||
self.scroll_top = (self.scroll_top - delta.y()).max(0.0).min(scroll_max);
|
||||
let scroll_max = (self.heights.summary().height - height).max(0.);
|
||||
self.scroll_top = (self.scroll_top - delta.y()).max(0.).min(scroll_max);
|
||||
|
||||
cx.notify();
|
||||
|
||||
true
|
||||
|
||||
Reference in New Issue
Block a user