forge
Explore
Log in

Don't you dare go Hollow

Fix consume-or-expel-left anim to the left of active column

Browse files at this commit

2a9d0e495a011a124b37532dfcfb3c780fd2eb89Ivan MolodetskikhParent: 7f132ec
Regressed in c4462d0c7fddfc11c9e98d43e3ef68a5b3c844ca.
src/layout/scrolling.rsmodified+14 -14
@@ -990,6 +990,19 @@ impl<W: LayoutElement> ScrollingSpace<W> {
990990 self.active_column_idx += 1;
991991 }
992992
993+ // Animate movement of other columns.
994+ let offset = self.column_x(idx + 1) - self.column_x(idx);
995+ let config = anim_config.unwrap_or(self.options.animations.window_movement.0);
996+ if self.active_column_idx <= idx {
997+ for col in &mut self.columns[idx + 1..] {
998+ col.animate_move_from_with_config(-offset, config);
999+ }
1000+ } else {
1001+ for col in &mut self.columns[..idx] {
1002+ col.animate_move_from_with_config(offset, config);
1003+ }
1004+ }
1005+
9931006 if activate {
9941007 // If this is the first window on an empty workspace, remove the effect of whatever
9951008 // view_offset was left over and skip the animation.
@@ -1007,19 +1020,6 @@ impl<W: LayoutElement> ScrollingSpace<W> {
10071020 self.activate_column_with_anim_config(idx, anim_config);
10081021 self.activate_prev_column_on_removal = prev_offset;
10091022 }
1010-
1011- // Animate movement of other columns.
1012- let offset = self.column_x(idx + 1) - self.column_x(idx);
1013- let config = anim_config.unwrap_or(self.options.animations.window_movement.0);
1014- if self.active_column_idx <= idx {
1015- for col in &mut self.columns[idx + 1..] {
1016- col.animate_move_from_with_config(-offset, config);
1017- }
1018- } else {
1019- for col in &mut self.columns[..idx] {
1020- col.animate_move_from_with_config(offset, config);
1021- }
1022- }
10231023 }
10241024
10251025 pub fn remove_active_tile(&mut self, transaction: Transaction) -> Option<RemovedTile<W>> {
@@ -1858,7 +1858,7 @@ impl<W: LayoutElement> ScrollingSpace<W> {
18581858 self.activate_prev_column_on_removal = None;
18591859 }
18601860
1861- if target_column_idx < self.active_column_idx {
1861+ if target_column_idx <= self.active_column_idx {
18621862 // Tiles to the left animate from the following column.
18631863 offset.x += self.column_x(target_column_idx + 1) - self.column_x(target_column_idx);
18641864 }