forge
Explore
Log in

Don't you dare go Hollow

layout/scrolling: Extract variable

Browse files at this commit

397e704d644d1bfe7736f2fdacbfe5742c7b2f9fIvan MolodetskikhParent: acc9d3e
src/layout/scrolling.rsmodified+4 -2
@@ -3439,9 +3439,11 @@ impl<W: LayoutElement> Column<W> {
3439 self.width3439 self.width
3440 };3440 };
3441 3441
3442+ let working_size = self.working_area.size;
3443+
3442 let width = self.resolve_column_width(width);3444 let width = self.resolve_column_width(width);
3443 let width = f64::max(f64::min(width, max_width), min_width);3445 let width = f64::max(f64::min(width, max_width), min_width);
3444- let max_tile_height = self.working_area.size.h - self.options.gaps * 2.;3446+ let max_tile_height = working_size.h - self.options.gaps * 2.;
3445 3447
3446 // If there are multiple windows in a column, clamp the non-auto window's height according3448 // If there are multiple windows in a column, clamp the non-auto window's height according
3447 // to other windows' min sizes.3449 // to other windows' min sizes.
@@ -3503,7 +3505,7 @@ impl<W: LayoutElement> Column<W> {
3503 .collect::<Vec<_>>();3505 .collect::<Vec<_>>();
3504 3506
3505 let gaps_left = self.options.gaps * (self.tiles.len() + 1) as f64;3507 let gaps_left = self.options.gaps * (self.tiles.len() + 1) as f64;
3506- let mut height_left = self.working_area.size.h - gaps_left;3508+ let mut height_left = working_size.h - gaps_left;
3507 let mut auto_tiles_left = self.tiles.len();3509 let mut auto_tiles_left = self.tiles.len();
3508 3510
3509 // Subtract all fixed-height tiles.3511 // Subtract all fixed-height tiles.