Rename bevy_math::rects conversion methods (#9159)

# Objective

Some of the conversion methods on the new rect types introduced in #7984
have misleading names.

## Solution

Rename all methods returning an `IRect` to `as_irect` and all methods
returning a `URect` to `as_urect`.

## Migration Guide

Replace uses of the old method names with the new method names.
This commit is contained in:
Arnav Mummineni 2023-07-15 17:10:39 -04:00 committed by GitHub
parent ede5848bf4
commit 94b574ad16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -311,13 +311,13 @@ impl Rect {
/// Returns self as [`IRect`] (i32)
#[inline]
pub fn as_urect(&self) -> IRect {
pub fn as_irect(&self) -> IRect {
IRect::from_corners(self.min.as_ivec2(), self.max.as_ivec2())
}
/// Returns self as [`URect`] (u32)
#[inline]
pub fn as_rect(&self) -> URect {
pub fn as_urect(&self) -> URect {
URect::from_corners(self.min.as_uvec2(), self.max.as_uvec2())
}
}

View File

@ -332,7 +332,7 @@ impl URect {
/// Returns self as [`IRect`] (i32)
#[inline]
pub fn as_urect(&self) -> IRect {
pub fn as_irect(&self) -> IRect {
IRect::from_corners(self.min.as_ivec2(), self.max.as_ivec2())
}
}