fix(core/ui): respect animation_disabled() on T3T1

pull/3787/head
Martin Milata 4 weeks ago
parent a4f41e55a2
commit 41b344d16a

@ -7,6 +7,7 @@ use crate::{
flow::base::Swipable,
geometry::{Axis, Offset, Rect},
shape::Renderer,
util,
},
};
@ -47,7 +48,7 @@ impl<T: Component + Paginate + Clone> SwipePage<T> {
fn handle_transition(ctx: &mut EventCtx, event: Event, transition: &mut Transition<T>) -> bool {
let mut finished = false;
if let Event::Timer(EventCtx::ANIM_FRAME_TIMER) = event {
if transition.animation.finished(Instant::now()) {
if transition.animation.finished(Instant::now()) || util::animation_disabled() {
finished = true;
} else {
ctx.request_anim_frame();

@ -7,6 +7,7 @@ use crate::{
flow::{base::Decision, FlowMsg, FlowState, FlowStore},
geometry::{Offset, Rect},
shape::Renderer,
util,
},
};
@ -105,7 +106,7 @@ impl<Q: FlowState, S: FlowStore> SwipeFlow<Q, S> {
Transition::External { animation, .. }
if matches!(event, Event::Timer(EventCtx::ANIM_FRAME_TIMER)) =>
{
if animation.finished(Instant::now()) {
if animation.finished(Instant::now()) || util::animation_disabled() {
finished = true;
ctx.request_paint();
self.store.event(i, ctx, Event::Attach)

Loading…
Cancel
Save