#[repr(C)]pub struct Rect2D {
pub min: Vec2,
pub max: Vec2,
}Expand description
A 2D axis-aligned rectangle defined by its top-left corner (min)
and bottom-right corner (max).
Mirrors the design of Aabb for 2D — used by UI surfaces (panels,
painters, hit-tests). Y axis points downward, matching most window
systems.
Fields§
§min: Vec2Top-left corner (smallest x, smallest y).
max: Vec2Bottom-right corner (largest x, largest y).
Implementations§
Source§impl Rect2D
impl Rect2D
Sourcepub const fn from_min_max(min: Vec2, max: Vec2) -> Self
pub const fn from_min_max(min: Vec2, max: Vec2) -> Self
Creates a rectangle from its min and max corners.
Sourcepub const fn from_min_size(min: Vec2, size: Vec2) -> Self
pub const fn from_min_size(min: Vec2, size: Vec2) -> Self
Creates a rectangle from a top-left corner and a size.
Sourcepub fn from_center_size(center: Vec2, size: Vec2) -> Self
pub fn from_center_size(center: Vec2, size: Vec2) -> Self
Creates a rectangle centered on center with the given size.
Trait Implementations§
impl Copy for Rect2D
impl StructuralPartialEq for Rect2D
Auto Trait Implementations§
impl Freeze for Rect2D
impl RefUnwindSafe for Rect2D
impl Send for Rect2D
impl Sync for Rect2D
impl Unpin for Rect2D
impl UnsafeUnpin for Rect2D
impl UnwindSafe for Rect2D
Blanket Implementations§
Source§impl<T> AppLifecycle for Twhere
T: ?Sized,
impl<T> AppLifecycle for Twhere
T: ?Sized,
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