From 47f6c85f64a20a9e32bf402941ecb78065aff80a Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Thu, 18 Apr 2024 00:30:12 +0400 Subject: Preserve tile move config on animation restarts This fixes a problem where consume-into-column would use resize animation config instead of the window-movement config in most cases (since a resize comes very shortly after the move starts). A similar change to the column movement anim is more detrimental than it's worth. --- src/layout/tile.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/layout') diff --git a/src/layout/tile.rs b/src/layout/tile.rs index 16779c10..447a8929 100644 --- a/src/layout/tile.rs +++ b/src/layout/tile.rs @@ -247,8 +247,14 @@ impl Tile { ) { let current_offset = self.render_offset(); + // Preserve the previous config if ongoing. + let anim = self.move_animation.take().map(|move_| move_.anim); + let anim = anim + .map(|anim| anim.restarted(1., 0., 0.)) + .unwrap_or_else(|| Animation::new(1., 0., 0., config)); + self.move_animation = Some(MoveAnimation { - anim: Animation::new(1., 0., 0., config), + anim, from: from + current_offset, }); } -- cgit