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> {
990 self.active_column_idx += 1;990 self.active_column_idx += 1;
991 }991 }
992 992
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+
993 if activate {1006 if activate {
994 // If this is the first window on an empty workspace, remove the effect of whatever1007 // If this is the first window on an empty workspace, remove the effect of whatever
995 // view_offset was left over and skip the animation.1008 // view_offset was left over and skip the animation.
@@ -1007,19 +1020,6 @@ impl<W: LayoutElement> ScrollingSpace<W> {
1007 self.activate_column_with_anim_config(idx, anim_config);1020 self.activate_column_with_anim_config(idx, anim_config);
1008 self.activate_prev_column_on_removal = prev_offset;1021 self.activate_prev_column_on_removal = prev_offset;
1009 }1022 }
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- }
1023 }1023 }
1024 1024
1025 pub fn remove_active_tile(&mut self, transaction: Transaction) -> Option<RemovedTile<W>> {1025 pub fn remove_active_tile(&mut self, transaction: Transaction) -> Option<RemovedTile<W>> {
@@ -1858,7 +1858,7 @@ impl<W: LayoutElement> ScrollingSpace<W> {
1858 self.activate_prev_column_on_removal = None;1858 self.activate_prev_column_on_removal = None;
1859 }1859 }
1860 1860
1861- if target_column_idx < self.active_column_idx {1861+ if target_column_idx <= self.active_column_idx {
1862 // Tiles to the left animate from the following column.1862 // Tiles to the left animate from the following column.
1863 offset.x += self.column_x(target_column_idx + 1) - self.column_x(target_column_idx);1863 offset.x += self.column_x(target_column_idx + 1) - self.column_x(target_column_idx);
1864 }1864 }