Skip to content

Commit

Permalink
Implement basic traits for AspectRatio (#12840)
Browse files Browse the repository at this point in the history
# Objective
`AspectRatio` is a newtype of `f32`, so it can implement basic traits;
`Copy`, `Clone`, `Debug`, `PartialEq` and `PartialOrd`.

## Solution
Derive basic traits for `AspectRatio`.
  • Loading branch information
mamekoro authored Apr 1, 2024
1 parent cf092d4 commit 8092e2c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crates/bevy_math/src/aspect_ratio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use crate::Vec2;

/// An `AspectRatio` is the ratio of width to height.
#[derive(Copy, Clone, Debug, PartialEq, PartialOrd)]
pub struct AspectRatio(f32);

impl AspectRatio {
Expand Down

0 comments on commit 8092e2c

Please sign in to comment.