iris: drive animation from painter frame time
This commit is contained in:
1 parent
9fe6aca1f1
commit
b1416d86bf
19 files changed
+171
-133
No files matched your search
@@ -669,7 +669,6 @@ async fn run_fling_phase(ctx: &mut iris::task::TaskCtx<Rsc>) -> String {
|
||||
ctx.update(|state: &mut BenchClient, rsc| {
|
||||
if let Some(screen) = &state.screen {
|
||||
(screen.list)(rsc).fling(FLING_VELOCITY_PX_S);
|
||||
animate_scroll(screen.list, rsc);
|
||||
}
|
||||
});
|
||||
wait_for_fling_settle(ctx).await;
|
||||
@@ -700,11 +699,6 @@ async fn read_anchor_position(ctx: &mut iris::task::TaskCtx<Rsc>) -> String {
|
||||
.await
|
||||
}
|
||||
|
||||
fn animate_scroll(scroll: iris::prelude::WeakWidget<iris::prelude::LazySpan>, rsc: &mut Rsc) {
|
||||
let id = scroll.id();
|
||||
rsc.ui_mut().animate(id);
|
||||
}
|
||||
|
||||
async fn wait_for_fling_settle(ctx: &mut iris::task::TaskCtx<Rsc>) {
|
||||
let cap = Duration::from_millis(FLING_SETTLE_CAP_MS);
|
||||
let started = Instant::now();
|
||||
|
||||
Reference in new issue
Block a user