Skip to content

Commit

Permalink
fix incorrect docs for JustifyItems and JustifySelf
Browse files Browse the repository at this point in the history
  • Loading branch information
tadeohepperle committed Aug 22, 2023
1 parent ebdf506 commit 8660bcc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/bevy_ui/src/ui_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ impl Default for AlignItems {
}
}

/// How items are aligned according to the cross axis
/// How items are aligned according to the main axis
#[derive(Copy, Clone, PartialEq, Eq, Debug, Serialize, Deserialize, Reflect)]
#[reflect(PartialEq, Serialize, Deserialize)]
pub enum JustifyItems {
Expand All @@ -665,7 +665,7 @@ pub enum JustifyItems {
Center,
/// Items are aligned at the baseline.
Baseline,
/// Items are stretched across the whole cross axis.
/// Items are stretched across the whole main axis.
Stretch,
}

Expand Down Expand Up @@ -714,12 +714,12 @@ impl Default for AlignSelf {
}
}

/// How this item is aligned according to the cross axis.
/// Overrides [`AlignItems`].
/// How this item is aligned according to the main axis.
/// Overrides [`JustifyItems`].
#[derive(Copy, Clone, PartialEq, Eq, Debug, Serialize, Deserialize, Reflect)]
#[reflect(PartialEq, Serialize, Deserialize)]
pub enum JustifySelf {
/// Use the parent node's [`AlignItems`] value to determine how this item should be aligned.
/// Use the parent node's [`JustifyItems`] value to determine how this item should be aligned.
Auto,
/// This item will be aligned with the start of the axis.
Start,
Expand All @@ -729,7 +729,7 @@ pub enum JustifySelf {
Center,
/// This item will be aligned at the baseline.
Baseline,
/// This item will be stretched across the whole cross axis.
/// This item will be stretched across the whole main axis.
Stretch,
}

Expand Down

1 comment on commit 8660bcc

@tadeohepperle
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs for JustifyContent and JustifyItems were wrong, justify acts on the main axis and not the cross axis.

Please sign in to comment.