forge
Explore
Log in

Don't you dare go Hollow

layout: Fix expel animation of the smaller window in column

Browse files at this commit

33b39913c7121a6c7b112beb0e329c3e64e4f57aIvan MolodetskikhParent: d5cbc35
src/layout/workspace.rsmodified+9 -7
@@ -2033,29 +2033,29 @@ impl<W: LayoutElement> Workspace<W> {
20332033 return;
20342034 }
20352035
2036- let offset =
2037- self.column_x(self.active_column_idx) - self.column_x(self.active_column_idx + 1);
2038- let mut offset = Point::from((offset, 0.));
2036+ let source_col_idx = self.active_column_idx;
2037+ let target_col_idx = self.active_column_idx + 1;
2038+ let cur_x = self.column_x(source_col_idx);
20392039
20402040 let source_column = &self.columns[self.active_column_idx];
20412041 if source_column.tiles.len() == 1 {
20422042 return;
20432043 }
20442044
2045- offset.x += source_column.render_offset().x;
2045+ let mut offset = Point::from((source_column.render_offset().x, 0.));
20462046 let prev_off = source_column.tile_offset(source_column.active_tile_idx);
20472047
20482048 let width = source_column.width;
20492049 let is_full_width = source_column.is_full_width;
20502050 let tile = self.remove_tile_by_idx(
2051- self.active_column_idx,
2051+ source_col_idx,
20522052 source_column.active_tile_idx,
20532053 Transaction::new(),
20542054 None,
20552055 );
20562056
20572057 self.add_tile(
2058- Some(self.active_column_idx + 1),
2058+ Some(target_col_idx),
20592059 tile,
20602060 true,
20612061 width,
@@ -2063,7 +2063,9 @@ impl<W: LayoutElement> Workspace<W> {
20632063 Some(self.options.animations.window_movement.0),
20642064 );
20652065
2066- let new_col = &mut self.columns[self.active_column_idx];
2066+ offset.x += cur_x - self.column_x(target_col_idx);
2067+
2068+ let new_col = &mut self.columns[target_col_idx];
20672069 offset += prev_off - new_col.tile_offset(0);
20682070 new_col.tiles[0].animate_move_from(offset);
20692071 }