aboutsummaryrefslogtreecommitdiff
path: root/src/animation.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2023-09-06 15:49:46 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2023-09-06 15:49:46 +0400
commit74607374819e000fb4d43a923176be17b838ff29 (patch)
treec3800ba27f7d75aef5f174fe7a7cc8f54a9027ed /src/animation.rs
parentc7a7b2daf29565a736f7e895230daeb9f18b7610 (diff)
downloadniri-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.rs5
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,
}