bevy/crates
ickshonpe fe37ba5360
Change the default for the measure_func field of ContentSize to None. (#9346)
# 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.
2023-08-07 23:06:40 +00:00
..
bevy_a11y Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_animation Simplify parallel iteration methods (#8854) 2023-07-23 11:09:24 +00:00
bevy_app Add track_caller to App::add_plugins (#9174) 2023-07-23 01:02:20 +00:00
bevy_asset Improve Mesh documentation (#9061) 2023-07-31 18:55:42 +00:00
bevy_audio update documentation on AudioSink (#9332) 2023-08-03 12:46:44 +00:00
bevy_core fix clippy::default_constructed_unit_structs and trybuild errors (#9144) 2023-07-13 22:23:04 +00:00
bevy_core_pipeline Extend the default render range of 2D camera (#9310) 2023-07-31 19:28:20 +00:00
bevy_derive Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_diagnostic Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_dylib Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_dynamic_plugin Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_ecs Fix ambiguous_with breaking run conditions (#9253) 2023-08-03 07:53:20 +00:00
bevy_ecs_compile_fail_tests Resolve clippy issues for rust 1.70.0 (#8738) 2023-06-01 21:05:05 +00:00
bevy_encase_derive Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_gilrs Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_gizmos Clarify immediate mode in Gizmos documentation (#9183) 2023-07-31 19:14:52 +00:00
bevy_gltf Improve Mesh documentation (#9061) 2023-07-31 18:55:42 +00:00
bevy_hierarchy Prevent setting parent as itself (#8980) 2023-08-07 23:00:48 +00:00
bevy_input Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_internal fix clippy::default_constructed_unit_structs and trybuild errors (#9144) 2023-07-13 22:23:04 +00:00
bevy_log Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_macro_utils Add some more helpful errors to BevyManifest when it doesn't find Cargo.toml (#9207) 2023-07-19 12:05:04 +00:00
bevy_macros_compile_fail_tests bevy_derive: Add #[deref] attribute (#8552) 2023-05-16 18:29:09 +00:00
bevy_math Add reflect impls to IRect and URect (#9191) 2023-07-23 01:02:00 +00:00
bevy_mikktspace Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_pbr Fix shader_material_glsl example after #9254 (#9311) 2023-07-31 13:14:40 +00:00
bevy_ptr Put #[repr(transparent)] attr to bevy_ptr types (#9068) 2023-07-14 18:55:15 +00:00
bevy_reflect bevy_reflect: Fix combined field attributes (#9322) 2023-08-07 23:04:00 +00:00
bevy_reflect_compile_fail_tests fix clippy::default_constructed_unit_structs and trybuild errors (#9144) 2023-07-13 22:23:04 +00:00
bevy_render include toplevel shader-associated defs (#9343) 2023-08-03 09:12:31 +00:00
bevy_scene Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_sprite Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_tasks Fix doc warning in bevy_tasks (#9348) 2023-08-05 13:53:05 +00:00
bevy_text Improve font size related docs (#9320) 2023-08-03 07:48:11 +00:00
bevy_time Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_transform Simplify parallel iteration methods (#8854) 2023-07-23 11:09:24 +00:00
bevy_ui Change the default for the measure_func field of ContentSize to None. (#9346) 2023-08-07 23:06:40 +00:00
bevy_utils Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_window improve documentation relating to WindowPlugin and Window (#9173) 2023-07-30 15:46:16 +00:00
bevy_winit Change WinitPlugin defaults to limit game update rate when window is not visible (#7611) 2023-08-02 23:41:23 +00:00