Skip to content

Commit

Permalink
layouts: reverse coordinates if orientation is reversed
Browse files Browse the repository at this point in the history
Fixes #38
  • Loading branch information
Antikyth committed Nov 22, 2023
1 parent 744374f commit 29529ab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/layout/implementations/node_changes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,12 @@ impl<Window> GroupNode<Window> {
let (group_primary, group_secondary) = (self.primary_dimension(), self.secondary_dimension());
let (group_primary_coord, group_secondary_coord) = (self.primary_coord(), self.secondary_coord());
// Set a node's dimensions and call `reconfigure_window` if it is a window.
let mut configure_node = |node: &mut Node<Window>, primary_coord, primary_dimension| {
let mut configure_node = |node: &mut Node<Window>, mut primary_coord, primary_dimension| {
// If the orientation is reversed, then reverse the coordinates.
if self.orientation.reversed() {
primary_coord = (group_primary as i32) - primary_coord - (primary_dimension as i32);
}

node.set_primary_coord(group_primary_coord + primary_coord, new_axis);
node.set_secondary_coord(group_secondary_coord, new_axis);

Expand Down

0 comments on commit 29529ab

Please sign in to comment.