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`.
This commit is contained in:
zhatuokun 2024-10-23 16:53:26 +08:00 committed by GitHub
parent 7c1f06941e
commit 3a0859b817
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -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;