diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/animation/mod.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/animation/mod.rs b/src/animation/mod.rs index 7ab0c585..2319c00b 100644 --- a/src/animation/mod.rs +++ b/src/animation/mod.rs @@ -48,6 +48,9 @@ pub enum Curve { impl Animation { pub fn new(from: f64, to: f64, initial_velocity: f64, config: niri_config::Animation) -> Self { + // Scale the velocity by slowdown to keep the touchpad gestures feeling right. + let initial_velocity = initial_velocity * ANIMATION_SLOWDOWN.load(Ordering::Relaxed); + let mut rv = Self::ease(from, to, initial_velocity, 0, Curve::EaseOutCubic); if config.off { rv.is_off = true; @@ -102,6 +105,9 @@ impl Animation { return self; } + // Scale the velocity by slowdown to keep the touchpad gestures feeling right. + let initial_velocity = initial_velocity * ANIMATION_SLOWDOWN.load(Ordering::Relaxed); + match self.kind { Kind::Easing { curve } => Self::ease( from, |
