From d53f693a3715fdd79481d75652cbf74286f4f387 Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Wed, 13 Dec 2023 23:38:38 +0100 Subject: [PATCH] fix(flex-row): awkward breakpoint after first row --- src/widget/flex_row/layout.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widget/flex_row/layout.rs b/src/widget/flex_row/layout.rs index bcd9e4a..108c6c1 100644 --- a/src/widget/flex_row/layout.rs +++ b/src/widget/flex_row/layout.rs @@ -34,7 +34,7 @@ pub fn resolve( let size = child_node.size(); // Calculate the required additional width to fit the item into the current row. - let required_width = size.width + let mut required_width = size.width + if row_buffer.is_empty() { 0.0 } else { @@ -58,7 +58,7 @@ pub fn resolve( flex_height += current_row_height; flex_width = flex_width.max(current_row_width); - + required_width -= row_spacing; current_row_width = 0.0; }