From 5e7ba86bfba3c45c37c4f2d7a8489cf879663f37 Mon Sep 17 00:00:00 2001 From: Han Damin Date: Sun, 8 Sep 2024 18:31:16 +0900 Subject: [PATCH] Update crates/bevy_math/src/aspect_ratio.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Gonçalo Rica Pais da Silva --- crates/bevy_math/src/aspect_ratio.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/bevy_math/src/aspect_ratio.rs b/crates/bevy_math/src/aspect_ratio.rs index 8f17dc4ed4009..fbb0a8f25c82c 100644 --- a/crates/bevy_math/src/aspect_ratio.rs +++ b/crates/bevy_math/src/aspect_ratio.rs @@ -26,6 +26,10 @@ impl AspectRatio { pub const ULTRAWIDE: Self = Self(21.0 / 9.0); /// Create a new [`AspectRatio`] from a given width and height. + /// + /// # Panics + /// Panics when the width and height values are invalid, such a zero or infinite widths/heights, or if either + /// value is `NaN`. #[inline] pub fn new(width: f32, height: f32) -> Self { Self::try_new(width, height).expect("Invalid aspect ratio")