forge
Explore
Log in

Don't you dare go Hollow

animation: Scale initial velocity by slowdown

Browse files at this commit

0b93c46ce80acbca086f3d9588e5ec83a48f2745Ivan MolodetskikhParent: 0fcd981
src/animation/mod.rsmodified+6 -0
@@ -48,6 +48,9 @@ pub enum Curve {
4848
4949 impl Animation {
5050 pub fn new(from: f64, to: f64, initial_velocity: f64, config: niri_config::Animation) -> Self {
51+ // Scale the velocity by slowdown to keep the touchpad gestures feeling right.
52+ let initial_velocity = initial_velocity * ANIMATION_SLOWDOWN.load(Ordering::Relaxed);
53+
5154 let mut rv = Self::ease(from, to, initial_velocity, 0, Curve::EaseOutCubic);
5255 if config.off {
5356 rv.is_off = true;
@@ -102,6 +105,9 @@ impl Animation {
102105 return self;
103106 }
104107
108+ // Scale the velocity by slowdown to keep the touchpad gestures feeling right.
109+ let initial_velocity = initial_velocity * ANIMATION_SLOWDOWN.load(Ordering::Relaxed);
110+
105111 match self.kind {
106112 Kind::Easing { curve } => Self::ease(
107113 from,