mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 05:40:03 -04:00
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:
@@ -54,6 +54,11 @@ impl State {
|
|||||||
pub fn store(self, ctx: &Context, id: Id) {
|
pub fn store(self, ctx: &Context, id: Id) {
|
||||||
ctx.data_mut(|d| d.insert_persisted(id, self));
|
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> {
|
pub struct ScrollAreaOutput<R> {
|
||||||
|
|||||||
Reference in New Issue
Block a user