diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-11-24 09:41:43 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-11-25 04:07:59 -0800 |
| commit | 4c22c3285d8b10fbcef1c45a0788c3ddca03ec62 (patch) | |
| tree | 506174fe9962a91598ac25d4d2dee1cdaa3d5292 /src/layout/closing_window.rs | |
| parent | 93cee2994ab9ccf59a09f61d5b8acf6cd937d654 (diff) | |
| download | niri-4c22c3285d8b10fbcef1c45a0788c3ddca03ec62.tar.gz niri-4c22c3285d8b10fbcef1c45a0788c3ddca03ec62.tar.bz2 niri-4c22c3285d8b10fbcef1c45a0788c3ddca03ec62.zip | |
Refactor animation timing to use lazy clocks
Diffstat (limited to 'src/layout/closing_window.rs')
| -rw-r--r-- | src/layout/closing_window.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/layout/closing_window.rs b/src/layout/closing_window.rs index 744c099e..12a77f92 100644 --- a/src/layout/closing_window.rs +++ b/src/layout/closing_window.rs @@ -1,5 +1,4 @@ use std::collections::HashMap; -use std::time::Duration; use anyhow::Context as _; use glam::{Mat3, Vec2}; @@ -138,15 +137,15 @@ impl ClosingWindow { }) } - pub fn advance_animations(&mut self, current_time: Duration) { + pub fn advance_animations(&mut self) { match &mut self.anim_state { AnimationState::Waiting { blocker, anim } => { if blocker.state() != BlockerState::Pending { - let anim = anim.restarted(current_time, 0., 1., 0.); + let anim = anim.restarted(0., 1., 0.); self.anim_state = AnimationState::Animating(anim); } } - AnimationState::Animating(anim) => anim.set_current_time(current_time), + AnimationState::Animating(_anim) => (), } } |
