From 3a0859b81798d092a78541cf8ad17fe133a639f3 Mon Sep 17 00:00:00 2001 From: zhatuokun <62168376+zhatuokun@users.noreply.github.com> Date: Wed, 23 Oct 2024 16:53:26 +0800 Subject: [PATCH] Fix: `Ui::new_child` does not consider the sizing_pass field of `UiBuilder` (#5262) During the sizing pass we want widgets to use up as little space as possible, but it does not consider the sizing_pass field of `UiBuilder`. --- crates/egui/src/ui.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/egui/src/ui.rs b/crates/egui/src/ui.rs index 9db1404d..786b93d5 100644 --- a/crates/egui/src/ui.rs +++ b/crates/egui/src/ui.rs @@ -276,7 +276,7 @@ impl Ui { let style = style.unwrap_or_else(|| self.style.clone()); let sense = sense.unwrap_or(Sense::hover()); - if self.sizing_pass { + if sizing_pass { // During the sizing pass we want widgets to use up as little space as possible, // so that we measure the only the space we _need_. layout.cross_justify = false;