pub struct Rect {
pub origin: Point,
pub size: Size,
}Fields§
§origin: Point§size: SizeImplementations§
Source§impl Rect
impl Rect
pub const ZERO: Self
pub const fn new(origin: Point, size: Size) -> Self
pub const fn from_xywh(x: f32, y: f32, width: f32, height: f32) -> Self
pub fn left(self) -> f32
pub fn right(self) -> f32
pub fn top(self) -> f32
pub fn bottom(self) -> f32
pub fn is_empty(self) -> bool
pub fn contains(self, p: Point) -> bool
pub fn contains_rect(self, other: Rect) -> bool
pub fn intersects(self, other: Rect) -> bool
pub fn intersect(self, other: Rect) -> Rect
pub fn union(self, other: Rect) -> Rect
pub fn inflate(self, dx: f32, dy: f32) -> Rect
pub fn translate(self, v: Vec2) -> Rect
pub fn center(self) -> Point
Trait Implementations§
impl Copy for Rect
impl StructuralPartialEq for Rect
Auto Trait Implementations§
impl Freeze for Rect
impl RefUnwindSafe for Rect
impl Send for Rect
impl Sync for Rect
impl Unpin for Rect
impl UnsafeUnpin for Rect
impl UnwindSafe for Rect
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