Skip to content

Commit

Permalink
Update crates/bevy_math/src/aspect_ratio.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Gonçalo Rica Pais da Silva <bluefinger@gmail.com>
  • Loading branch information
miniex and Bluefinger authored Sep 8, 2024
1 parent e789b31 commit 5e7ba86
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/bevy_math/src/aspect_ratio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 5e7ba86

Please sign in to comment.