Skip to content

Commit

Permalink
Wrap animator in main proceed thread
Browse files Browse the repository at this point in the history
  • Loading branch information
filtsin committed Mar 22, 2023
1 parent eb13330 commit 0afbdd1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ fn main_inner() {
surface::EventStatus::Idle => {}
};

if animator.proceed() {
if animations && animator.proceed() {
should_redraw = true
}

Expand All @@ -273,9 +273,14 @@ fn main_inner() {
}

display.flush().unwrap();
event_loop
.dispatch(animator.proceed_step(), &mut ())
.unwrap();

let timeout = if animations {
animator.proceed_step()
} else {
None
};

event_loop.dispatch(timeout, &mut ()).unwrap();
}
}

Expand Down

0 comments on commit 0afbdd1

Please sign in to comment.