layout: Fix view_offset value when moving column

This commit is contained in:
Ivan Molodetskikh
2024-04-08 17:27:56 +04:00
parent 83aec41df3
commit 03fc439150
+2 -3
View File
@@ -961,9 +961,8 @@ impl<W: LayoutElement> Workspace<W> {
let column = self.columns.remove(self.active_column_idx);
self.columns.insert(new_idx, column);
// FIXME: should this be different when always centering?
self.view_offset =
self.compute_new_view_offset_for_column(current_x, self.active_column_idx);
// Preserve the camera position when moving to the left.
self.view_offset = current_x - self.column_x(self.active_column_idx);
self.activate_column(new_idx);
}