layout: Fix view_offset value when moving column
Browse files at this commit03fc439150c5a0006a4e86d1e2ad33fede0ddacaParent: 83aec411 changed file +2 -3
- src/layout/workspace.rs +2 -3
src/layout/workspace.rsmodified+2 -3
| @@ -961,9 +961,8 @@ impl<W: LayoutElement> Workspace<W> { | |||
| 961 | let column = self.columns.remove(self.active_column_idx); | 961 | let column = self.columns.remove(self.active_column_idx); |
| 962 | self.columns.insert(new_idx, column); | 962 | self.columns.insert(new_idx, column); |
| 963 | 963 | ||
| 964 | - // FIXME: should this be different when always centering? | 964 | + // Preserve the camera position when moving to the left. |
| 965 | - self.view_offset = | 965 | + self.view_offset = current_x - self.column_x(self.active_column_idx); |
| 966 | - self.compute_new_view_offset_for_column(current_x, self.active_column_idx); | ||
| 967 | 966 | ||
| 968 | self.activate_column(new_idx); | 967 | self.activate_column(new_idx); |
| 969 | } | 968 | } |