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 fn from_origin_size(origin: Point, size: Size) -> Rect
pub fn from_size(size: Size) -> Rect
pub fn translate(&self, dx: f32, dy: f32) -> Rect
pub fn contains(&self, x: f32, y: f32) -> bool
Sourcepub fn intersect(&self, other: Rect) -> Option<Rect>
pub fn intersect(&self, other: Rect) -> Option<Rect>
Returns the intersection of two rectangles, or None if they don’t overlap.
pub fn union(&self, other: Rect) -> Rect
Trait Implementations§
Source§impl RenderHash for Rect
impl RenderHash for Rect
fn render_hash(&self) -> u64
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