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:
parent
0be1529d15
commit
e61b5a1d67
@ -349,6 +349,13 @@ impl UiRect {
|
|||||||
bottom: Val::ZERO,
|
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.
|
/// Creates a new [`UiRect`] from the values specified.
|
||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
|
Loading…
Reference in New Issue
Block a user