Skip to content

Commit

Permalink
server/panes/floating: Fix resize increment
Browse files Browse the repository at this point in the history
for undirected resizes
  • Loading branch information
har7an committed Dec 7, 2022
1 parent 8b7b231 commit 38b5940
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions zellij-server/src/panes/floating_panes/floating_pane_grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,12 @@ impl<'a> FloatingPaneGrid<'a> {
.with_context(err_context)?
.position_and_size();

let change_by = if strategy.direction.is_none() {
(change_by.0 / 2, change_by.1 / 2)
} else {
change_by
};

// Move left border
if strategy.move_left_border_left() || strategy.move_all_borders_out() {
let increment = std::cmp::min(geometry.x.saturating_sub(self.viewport.x), change_by.0);
Expand Down

0 comments on commit 38b5940

Please sign in to comment.