diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-09-06 15:49:46 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-09-06 15:49:46 +0400 |
| commit | 74607374819e000fb4d43a923176be17b838ff29 (patch) | |
| tree | c3800ba27f7d75aef5f174fe7a7cc8f54a9027ed /src/animation.rs | |
| parent | c7a7b2daf29565a736f7e895230daeb9f18b7610 (diff) | |
| download | niri-74607374819e000fb4d43a923176be17b838ff29.tar.gz niri-74607374819e000fb4d43a923176be17b838ff29.tar.bz2 niri-74607374819e000fb4d43a923176be17b838ff29.zip | |
Add animation-slowdown debug setting
Diffstat (limited to 'src/animation.rs')
| -rw-r--r-- | src/animation.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/animation.rs b/src/animation.rs index 27449243..430e3516 100644 --- a/src/animation.rs +++ b/src/animation.rs @@ -2,9 +2,12 @@ use std::time::Duration; use keyframe::functions::EaseOutCubic; use keyframe::EasingFunction; +use portable_atomic::{AtomicF64, Ordering}; use crate::utils::get_monotonic_time; +pub static ANIMATION_SLOWDOWN: AtomicF64 = AtomicF64::new(1.); + #[derive(Debug)] pub struct Animation { from: f64, @@ -23,7 +26,7 @@ impl Animation { Self { from, to, - duration: over, + duration: over.mul_f64(ANIMATION_SLOWDOWN.load(Ordering::Relaxed)), start_time: now, current_time: now, } |
