Skip to content

Commit

Permalink
Size::height sets width not height (#7478)
Browse files Browse the repository at this point in the history
# Objective
```rust
pub const fn height(width: Val) -> Self {
        Self {
            width,
            height: Val::DEFAULT,
        }
    }
```
:sweat:

## Solution
Swap `width` and `height`.
  • Loading branch information
ickshonpe committed Feb 2, 2023
1 parent be46d15 commit 00ff8ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/bevy_ui/src/geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,10 @@ impl Size {
}

/// Creates a new [`Size`] where `height` takes the given value.
pub const fn height(width: Val) -> Self {
pub const fn height(height: Val) -> Self {
Self {
width,
height: Val::DEFAULT,
width: Val::DEFAULT,
height,
}
}

Expand Down

0 comments on commit 00ff8ad

Please sign in to comment.