From 6cb5135f3477e63ed1738e19ba95a07ce52093ae Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sun, 29 Dec 2024 22:22:55 +0300 Subject: Clamp single tiled window height Now that we have floating for taller-than-screen windows. --- src/layout/scrolling.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/layout/scrolling.rs b/src/layout/scrolling.rs index 73e55451..a378c461 100644 --- a/src/layout/scrolling.rs +++ b/src/layout/scrolling.rs @@ -3553,8 +3553,7 @@ impl Column { } }; - // If there are multiple windows in a column, clamp the height according to other windows' - // min sizes. + // Clamp the height according to other windows' min sizes, or simply to working area height. let min_height_taken = self .tiles .iter() @@ -3562,12 +3561,10 @@ impl Column { .filter(|(idx, _)| *idx != tile_idx) .map(|(_, tile)| f64::max(1., tile.min_size().h) + self.options.gaps) .sum::(); - if min_height_taken > 0. { - let height_left = - self.working_area.size.h - self.options.gaps - min_height_taken - self.options.gaps; - let height_left = f64::max(1., tile.window_height_for_tile_height(height_left)); - window_height = f64::min(height_left, window_height); - } + let height_left = + self.working_area.size.h - self.options.gaps - min_height_taken - self.options.gaps; + let height_left = f64::max(1., tile.window_height_for_tile_height(height_left)); + window_height = f64::min(height_left, window_height); // Clamp it against the window height constraints. let win = &self.tiles[tile_idx].window(); -- cgit