From 00ff8adfd6ed85e004038f6aa317af7b0fd7fd03 Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Thu, 2 Feb 2023 22:09:21 +0000 Subject: [PATCH] `Size::height` sets `width` not `height` (#7478) # Objective ```rust pub const fn height(width: Val) -> Self { Self { width, height: Val::DEFAULT, } } ``` :sweat: ## Solution Swap `width` and `height`. --- crates/bevy_ui/src/geometry.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bevy_ui/src/geometry.rs b/crates/bevy_ui/src/geometry.rs index 291bc5301f..8fe46fae47 100644 --- a/crates/bevy_ui/src/geometry.rs +++ b/crates/bevy_ui/src/geometry.rs @@ -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, } }