Skip to content

Commit 16ce385

Browse files
committed
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.
1 parent 9ef840e commit 16ce385

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

crates/bevy_ui/src/ui_node.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,20 @@ pub struct Style {
249249
pub flex_shrink: f32,
250250
/// The initial size of the item
251251
pub flex_basis: Val,
252-
/// The size of the flexbox
252+
/// The ideal size of the flexbox
253+
///
254+
/// `size.width` is used when it is within the bounds defined by `min_size.width` and `max_size.width`.
255+
/// `size.height` is used when it is within the bounds defined by `min_size.height` and `max_size.height`.
253256
pub size: Size,
254257
/// The minimum size of the flexbox
258+
///
259+
/// `min_size.width` is used if it is greater than either `size.width` or `max_size.width`, or both.
260+
/// `min_size.height` is used if it is greater than either `size.height` or `max_size.height`, or both.
255261
pub min_size: Size,
256262
/// The maximum size of the flexbox
263+
///
264+
/// `max_size.width` is used if it is within the bounds defined by `min_size.width` and `size.width`.
265+
/// `max_size.height` is used if it is within the bounds defined by `min_size.height` and `size.height.
257266
pub max_size: Size,
258267
/// The aspect ratio of the flexbox
259268
pub aspect_ratio: Option<f32>,

0 commit comments

Comments
 (0)