UiRect::AUTO (#18359)

# Objective

Add a `UiRect::AUTO` const which is a `UiRect` with all its edge values
set to `Val::Auto`.

IIRC `UiRect`'s default for its fields a few versions ago was
`Val::Auto` because positions were represented using a `UiRect` and they
required `Val::Auto` as a default. Then when position was split up and
the `UiRect` default was changed, we forgot add a `UiRect::AUTO` const.
This commit is contained in:
ickshonpe 2025-03-17 18:24:21 +00:00 committed by GitHub
parent 0be1529d15
commit e61b5a1d67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -349,6 +349,13 @@ impl UiRect {
bottom: Val::ZERO,
};
pub const AUTO: Self = Self {
left: Val::Auto,
right: Val::Auto,
top: Val::Auto,
bottom: Val::Auto,
};
/// Creates a new [`UiRect`] from the values specified.
///
/// # Example