mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
eaac730617
# Objective `Size::width` sets the `height` field to `Val::DEFAULT` which is `Val::Undefined`, but the default for `Size` `height` is `Val::Auto`. `Size::height` has the same problem, but with the `width` field. The UI examples specify numeric values in many places where they could either be elided or replaced by composition of the Flex enum properties. related: https://github.com/bevyengine/bevy/pull/7468 fixes: https://github.com/bevyengine/bevy/issues/6498 ## Solution Change `Size::width` so it sets `height` to `Val::AUTO` and change `Size::height` so it sets `width` to `Val::AUTO`. Added some tests so this doesn't happen again. ## Changelog Changed `Size::width` so it sets the `height` to `Val::AUTO`. Changed `Size::height` so it sets the `width` to `Val::AUTO`. Added tests to `geometry.rs` for `Size` and `UiRect` to ensure correct behaviour. Simplified the UI examples. Replaced numeric values with the Flex property enums or elided them where possible, and removed the remaining use of auto margins. ## Migration Guide The `Size::width` constructor function now sets the `height` to `Val::Auto` instead of `Val::Undefined`. The `Size::height` constructor function now sets the `width` to `Val::Auto` instead of `Val::Undefined`. |
||
---|---|---|
.. | ||
button.rs | ||
font_atlas_debug.rs | ||
relative_cursor_position.rs | ||
text.rs | ||
text_debug.rs | ||
text_layout.rs | ||
transparency_ui.rs | ||
ui.rs | ||
ui_scaling.rs | ||
window_fallthrough.rs | ||
z_index.rs |