bevy/crates/bevy_ui/src
ickshonpe a2bd93aedc
Make GridPlacement's fields non-zero and add accessor functions. (#9486)
# Objective

* There is no way to read the fields of `GridPlacement` once set. 
* Values of `0` for `GridPlacement`'s fields are invalid but can be set.
* A non-zero representation would be half the size.

fixes #9474

## Solution
* Add `get_start`, `get_end` and `get_span` accessor methods.
* Change`GridPlacement`'s constructor functions to panic on arguments of
zero.
* Use non-zero types instead of primitives for `GridPlacement`'s fields.

---

## Changelog

`bevy_ui::ui_node::GridPlacement`:
* Field types have been changed to `Option<NonZeroI16>` and
`Option<NonZeroU16>`. This is because zero values are not valid for
`GridPlacement`. Previously, Taffy interpreted these as auto variants.
* Constructor functions for `GridPlacement` panic on arguments of `0`.
* Added accessor functions: `get_start`, `get_end`, and `get_span`.
These return the inner primitive value (if present) of the respective
fields.

## Migration Guide
`GridPlacement`'s constructor functions no longer accept values of `0`.
Given any argument of `0` they will panic with a `GridPlacementError`.
2023-08-28 17:21:08 +00:00
..
layout Make GridPlacement's fields non-zero and add accessor functions. (#9486) 2023-08-28 17:21:08 +00:00
render Swap TransparentUi to use a stable sort (#9598) 2023-08-27 20:37:17 +00:00
widget Cleanup some bevy_text pipeline.rs (#9111) 2023-08-28 16:46:16 +00:00
accessibility.rs Move bevy_ui accessibility systems to PostUpdate. (#8653) 2023-05-23 23:50:48 +00:00
camera_config.rs bevy_reflect: FromReflect Ergonomics Implementation (#6056) 2023-06-29 01:31:34 +00:00
focus.rs Change UiScale to a tuple struct (#9444) 2023-08-16 18:18:50 +00:00
geometry.rs Added Val::ZERO Constant (#9566) 2023-08-26 14:00:53 +00:00
lib.rs Change UiScale to a tuple struct (#9444) 2023-08-16 18:18:50 +00:00
measurement.rs Change the default for the measure_func field of ContentSize to None. (#9346) 2023-08-07 23:06:40 +00:00
node_bundles.rs Remove unnecessary doc string (#9481) 2023-08-21 01:39:56 +00:00
stack.rs Fix typos throughout the project (#9090) 2023-07-10 00:11:51 +00:00
ui_node.rs Make GridPlacement's fields non-zero and add accessor functions. (#9486) 2023-08-28 17:21:08 +00:00
update.rs Split UI Overflow by axis (#8095) 2023-04-17 22:23:52 +00:00