Add `scroll_area::State::velocity` (#3300)
* Implement `has_momentum` * Add doc comment * Call it `has_velocity` * Implement `velocity` method --------- Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This commit is contained in:
parent
1b8e8cb38e
commit
cf163cc954
|
|
@ -54,6 +54,11 @@ impl State {
|
|||
pub fn store(self, ctx: &Context, id: Id) {
|
||||
ctx.data_mut(|d| d.insert_persisted(id, self));
|
||||
}
|
||||
|
||||
/// Get the current kinetic scrolling velocity.
|
||||
pub fn velocity(&self) -> Vec2 {
|
||||
self.vel
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ScrollAreaOutput<R> {
|
||||
|
|
|
|||
Loading…
Reference in New Issue