From 16ce3859e38508ac642aaaa3178ae99f515b1e23 Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Fri, 10 Feb 2023 23:50:28 +0000 Subject: [PATCH] Document how `Style`'s size constraints interact (#7613) # Objective Document how `Style`'s size constraints interact. # Changelog * Added extra doc comments to `Style`'s size fields. --- crates/bevy_ui/src/ui_node.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/bevy_ui/src/ui_node.rs b/crates/bevy_ui/src/ui_node.rs index bc0981cff9..6ff0e923c6 100644 --- a/crates/bevy_ui/src/ui_node.rs +++ b/crates/bevy_ui/src/ui_node.rs @@ -249,11 +249,20 @@ pub struct Style { pub flex_shrink: f32, /// The initial size of the item pub flex_basis: Val, - /// The size of the flexbox + /// The ideal size of the flexbox + /// + /// `size.width` is used when it is within the bounds defined by `min_size.width` and `max_size.width`. + /// `size.height` is used when it is within the bounds defined by `min_size.height` and `max_size.height`. pub size: Size, /// The minimum size of the flexbox + /// + /// `min_size.width` is used if it is greater than either `size.width` or `max_size.width`, or both. + /// `min_size.height` is used if it is greater than either `size.height` or `max_size.height`, or both. pub min_size: Size, /// The maximum size of the flexbox + /// + /// `max_size.width` is used if it is within the bounds defined by `min_size.width` and `size.width`. + /// `max_size.height` is used if it is within the bounds defined by `min_size.height` and `size.height. pub max_size: Size, /// The aspect ratio of the flexbox pub aspect_ratio: Option,