pub struct Rect {
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
}Fields§
§x: f32§y: f32§width: f32§height: f32Implementations§
Source§impl Rect
impl Rect
pub const ZERO: Rect
pub const fn new(x: f32, y: f32, width: f32, height: f32) -> Self
pub fn from_origin_size(origin: Point, size: Size) -> Self
pub fn origin(self) -> Point
pub fn size(self) -> Size
pub fn right(self) -> f32
pub fn bottom(self) -> f32
pub fn center(self) -> Point
pub fn contains(self, point: Point) -> bool
Sourcepub fn inset(self, edges: Sides<f32>) -> Self
pub fn inset(self, edges: Sides<f32>) -> Self
The rectangle shrunk by edges on each side, never below zero size.
pub fn intersection(self, other: Rect) -> Rect
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