Add scroll_to operation for absolute scroll

This commit is contained in:
Cory Forsstrom 2023-04-14 13:32:44 -07:00
parent 4b05f42fd6
commit b623f280ed
No known key found for this signature in database
GPG key ID: 1DFE170A4415C9F5
4 changed files with 90 additions and 23 deletions

View file

@ -36,7 +36,7 @@ enum Message {
ScrollerWidthChanged(u16),
ScrollToBeginning,
ScrollToEnd,
Scrolled(scrollable::RelativeOffset),
Scrolled(scrollable::CurrentOffset),
}
impl Application for ScrollableDemo {
@ -105,7 +105,7 @@ impl Application for ScrollableDemo {
)
}
Message::Scrolled(offset) => {
self.current_scroll_offset = offset;
self.current_scroll_offset = offset.relative;
Command::none()
}