pub struct URect { /* private fields */ }Expand description
A bounding rectangle with positive integer coordinates.
Implementations§
Source§impl URect
impl URect
Sourcepub fn from_pos_size(pos: UVec2, size: UVec2) -> Self
pub fn from_pos_size(pos: UVec2, size: UVec2) -> Self
Create a Rect from a position and size.
Sourcepub fn as_rect(&self) -> Rect
pub fn as_rect(&self) -> Rect
The position of the rectangle’s upper-left corner. This is the minimum value enclosed by the rectangle.
Sourcepub fn contains_point(&self, point: UVec2) -> bool
pub fn contains_point(&self, point: UVec2) -> bool
Tells whether the given point is contained within the rectangle.
If the point lies on the rectangle’s boundary, it is considered inside.
Sourcepub fn intersects(&self, other: &Self) -> bool
pub fn intersects(&self, other: &Self) -> bool
Tells whether two rectangles intersect.
If the rectangles touch but do not overlap, they are considered not intersecting.
Trait Implementations§
impl Copy for URect
impl Eq for URect
impl StructuralPartialEq for URect
Auto Trait Implementations§
impl Freeze for URect
impl RefUnwindSafe for URect
impl Send for URect
impl Sync for URect
impl Unpin for URect
impl UnwindSafe for URect
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more