From 73e9ef5fe20825ed12f1bb05ba10e7eb69bc7662 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Wed, 17 Apr 2024 14:06:32 +0400 Subject: Resolve animation defaults during parsing --- src/layout/tile.rs | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'src/layout/tile.rs') diff --git a/src/layout/tile.rs b/src/layout/tile.rs index 87c168b0..16779c10 100644 --- a/src/layout/tile.rs +++ b/src/layout/tile.rs @@ -150,13 +150,7 @@ impl Tile { let change = self.window.size().to_point() - size_from.to_point(); let change = max(change.x.abs(), change.y.abs()); if change > RESIZE_ANIMATION_THRESHOLD { - let anim = Animation::new( - 0., - 1., - 0., - self.options.animations.window_resize, - niri_config::Animation::default_window_resize(), - ); + let anim = Animation::new(0., 1., 0., self.options.animations.window_resize.0); self.resize_animation = Some(ResizeAnimation { anim, size_from, @@ -230,8 +224,7 @@ impl Tile { 0., 1., 0., - self.options.animations.window_open, - niri_config::Animation::default_window_open(), + self.options.animations.window_open.0, )); } @@ -244,23 +237,18 @@ impl Tile { } pub fn animate_move_from(&mut self, from: Point) { - self.animate_move_from_with_config( - from, - self.options.animations.window_movement, - niri_config::Animation::default_window_movement(), - ); + self.animate_move_from_with_config(from, self.options.animations.window_movement.0); } pub fn animate_move_from_with_config( &mut self, from: Point, config: niri_config::Animation, - default: niri_config::Animation, ) { let current_offset = self.render_offset(); self.move_animation = Some(MoveAnimation { - anim: Animation::new(1., 0., 0., config, default), + anim: Animation::new(1., 0., 0., config), from: from + current_offset, }); } -- cgit