From 4eac385992f514af03764505f25142152209b125 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Thu, 29 May 2025 15:00:55 -0700 Subject: [PATCH] two_row_col_toplevel_layout: Fix cross axis (vertical) spacing Fixes two row layouts being cut off at the bottom. --- .../toplevels/toplevel_layout/two_row_col_toplevel_layout.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widgets/toplevels/toplevel_layout/two_row_col_toplevel_layout.rs b/src/widgets/toplevels/toplevel_layout/two_row_col_toplevel_layout.rs index 3a7edcf..e721fa7 100644 --- a/src/widgets/toplevels/toplevel_layout/two_row_col_toplevel_layout.rs +++ b/src/widgets/toplevels/toplevel_layout/two_row_col_toplevel_layout.rs @@ -36,7 +36,7 @@ impl AxisToplevelLayout for TwoRowColToplevelLayout { let half_max_limit = AxisSize { main: max_limit.main, - cross: max_limit.cross / 2. - self.0.spacing as f32, + cross: (max_limit.cross - self.0.spacing as f32) / 2., }; // See if two row layout is better @@ -60,7 +60,7 @@ impl AxisToplevelLayout for TwoRowColToplevelLayout { .0 .layout(half_max_limit, &toplevels[split_point..]) .map(move |mut rect| { - rect.origin.cross += max_limit.cross / 2. + self.0.spacing as f32; + rect.origin.cross += half_max_limit.cross + self.0.spacing as f32; rect }); return itertools::Either::Left(row1.chain(row2));