pub struct Rect {
pub origin: Point,
pub size: Size,
}Fields§
§origin: Point§size: SizeImplementations§
Source§impl Rect
impl Rect
pub const ZERO: Rect
pub const EVERYTHING: Rect
pub const fn new(x: f32, y: f32, width: f32, height: f32) -> Self
pub fn from_min_max(min: Point, max: Point) -> Self
pub fn max(&self) -> Point
pub fn center(&self) -> Point
pub fn is_empty(&self) -> bool
pub fn contains(&self, point: Point) -> bool
pub fn intersect(&self, other: &Rect) -> Rect
pub fn union(&self, other: &Rect) -> Rect
pub fn translate(&self, by: Point) -> Rect
pub fn scale(&self, factor: f32) -> Rect
pub fn inflate(&self, amount: f32) -> Rect
pub fn to_array(self) -> [f32; 4]
Trait Implementations§
impl Copy for Rect
impl StructuralPartialEq for Rect
Auto Trait Implementations§
impl Forget for Rect
impl Freeze for Rect
impl Move 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