mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 20:53:53 +00:00
fe37ba5360
# Objective The default for `ContentSize` should have the `measure_func` field set to `None`, instead of a fixed size of zero. This means that until a measure func is set the size of the UI node will be determined by its `Style` constraints. This is preferable as it allows users to specify the space the Node should take up in the layout while waiting for content to load. ## Solution Derive `Default` for `ContentSize`. The PR also adds a `fixed_size` helper function to make it a bit easier to access the old behaviour. ## Changelog * Derived `Default` for `ContentSize` * Added a `fixed_size` helper function to `ContentSize` that creates a new `ContentSize` with a `MeasureFunc` that always returns the same value, regardless of layout constraints. ## Migration Guide The default for `ContentSize` now sets its `measure_func` to `None`, instead of a fixed size measure that returns `Vec2::ZERO`. The helper function `fixed_size` can be called with `ContentSize::fixed_size(Vec2::ZERO)` to get the previous behaviour. |
||
---|---|---|
.. | ||
bevy_a11y | ||
bevy_animation | ||
bevy_app | ||
bevy_asset | ||
bevy_audio | ||
bevy_core | ||
bevy_core_pipeline | ||
bevy_derive | ||
bevy_diagnostic | ||
bevy_dylib | ||
bevy_dynamic_plugin | ||
bevy_ecs | ||
bevy_ecs_compile_fail_tests | ||
bevy_encase_derive | ||
bevy_gilrs | ||
bevy_gizmos | ||
bevy_gltf | ||
bevy_hierarchy | ||
bevy_input | ||
bevy_internal | ||
bevy_log | ||
bevy_macro_utils | ||
bevy_macros_compile_fail_tests | ||
bevy_math | ||
bevy_mikktspace | ||
bevy_pbr | ||
bevy_ptr | ||
bevy_reflect | ||
bevy_reflect_compile_fail_tests | ||
bevy_render | ||
bevy_scene | ||
bevy_sprite | ||
bevy_tasks | ||
bevy_text | ||
bevy_time | ||
bevy_transform | ||
bevy_ui | ||
bevy_utils | ||
bevy_window | ||
bevy_winit |