From 196ee3001eb6a6b1fb1361f1c960925713fd4d13 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Fri, 17 Nov 2023 00:02:30 +0000 Subject: [PATCH] Respect max box constraints in taffy_layout --- src/widget/taffy_layout.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/widget/taffy_layout.rs b/src/widget/taffy_layout.rs index a0dc27a05..02875f0e9 100644 --- a/src/widget/taffy_layout.rs +++ b/src/widget/taffy_layout.rs @@ -344,9 +344,10 @@ impl Widget for TaffyLayout { } cx.request_paint(); + let max = bc.max(); Size { - width: output.size.width as f64, - height: output.size.height as f64, + width: (output.size.width as f64).min(max.width), + height: (output.size.height as f64).min(max.height), } // }) }