pub struct CanvasRect {
pub x: i32,
pub y: i32,
pub width: i32,
pub height: i32,
}Expand description
Rectangle geometry used by CanvasScene primitives.
Fields§
§x: i32§y: i32§width: i32§height: i32Implementations§
Source§impl CanvasRect
impl CanvasRect
Sourcepub fn bounding_union(&self, other: &CanvasRect) -> CanvasRect
pub fn bounding_union(&self, other: &CanvasRect) -> CanvasRect
Computes the minimal enclosing bounding box of self and other.
If either rectangle has non-positive dimensions, the other rectangle is returned. If both have non-positive dimensions, a zero-sized rectangle at the minimum origin is returned.
Sourcepub fn contains_rect(&self, other: &CanvasRect) -> bool
pub fn contains_rect(&self, other: &CanvasRect) -> bool
Returns true if this rectangle fully encloses other.
Sourcepub fn intersects(&self, other: &CanvasRect) -> bool
pub fn intersects(&self, other: &CanvasRect) -> bool
Returns true if this rectangle intersects other.
Trait Implementations§
Source§impl Clone for CanvasRect
impl Clone for CanvasRect
impl Copy for CanvasRect
Source§impl Debug for CanvasRect
impl Debug for CanvasRect
impl Eq for CanvasRect
Source§impl PartialEq for CanvasRect
impl PartialEq for CanvasRect
impl StructuralPartialEq for CanvasRect
Auto Trait Implementations§
impl Forget for CanvasRect
impl Freeze for CanvasRect
impl Move for CanvasRect
impl RefUnwindSafe for CanvasRect
impl Send for CanvasRect
impl Sync for CanvasRect
impl Unpin for CanvasRect
impl UnsafeUnpin for CanvasRect
impl UnwindSafe for CanvasRect
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