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:
parent
ede5848bf4
commit
94b574ad16
@ -311,13 +311,13 @@ impl Rect {
|
|||||||
|
|
||||||
/// Returns self as [`IRect`] (i32)
|
/// Returns self as [`IRect`] (i32)
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn as_urect(&self) -> IRect {
|
pub fn as_irect(&self) -> IRect {
|
||||||
IRect::from_corners(self.min.as_ivec2(), self.max.as_ivec2())
|
IRect::from_corners(self.min.as_ivec2(), self.max.as_ivec2())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns self as [`URect`] (u32)
|
/// Returns self as [`URect`] (u32)
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn as_rect(&self) -> URect {
|
pub fn as_urect(&self) -> URect {
|
||||||
URect::from_corners(self.min.as_uvec2(), self.max.as_uvec2())
|
URect::from_corners(self.min.as_uvec2(), self.max.as_uvec2())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -332,7 +332,7 @@ impl URect {
|
|||||||
|
|
||||||
/// Returns self as [`IRect`] (i32)
|
/// Returns self as [`IRect`] (i32)
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn as_urect(&self) -> IRect {
|
pub fn as_irect(&self) -> IRect {
|
||||||
IRect::from_corners(self.min.as_ivec2(), self.max.as_ivec2())
|
IRect::from_corners(self.min.as_ivec2(), self.max.as_ivec2())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user