From 33cda6d9f7356dee70e1df4be910c8937ffb0d23 Mon Sep 17 00:00:00 2001 From: JoeZane Date: Thu, 29 May 2025 03:40:12 +0800 Subject: [PATCH] upd: fix layout error when child size is 0 --- tmui/src/layout.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tmui/src/layout.rs b/tmui/src/layout.rs index 0518bf6..f749592 100644 --- a/tmui/src/layout.rs +++ b/tmui/src/layout.rs @@ -294,14 +294,10 @@ impl SizeCalculation for dyn WidgetImpl { let visible = self.visible(); let mut resized = false; - if (size.width() == 0 && visible) - || (!self.hexpand() && !self.fixed_width()) && child_size.width() != 0 - { + if (size.width() == 0 && visible) || (!self.hexpand() && !self.fixed_width()) { self.set_fixed_width(child_size.width()); } - if (size.height() == 0 && visible) - || (!self.vexpand() && !self.fixed_height()) && child_size.height() != 0 - { + if (size.height() == 0 && visible) || (!self.vexpand() && !self.fixed_height()) { self.set_fixed_height(child_size.height()); }