pub struct Rect {
pub x0: f32,
pub y0: f32,
pub x1: f32,
pub y1: f32,
}
Expand description
A rectangle represented by two diagonally opposite corners at arbitrary coordinates
Fields§
§x0: f32
§y0: f32
§x1: f32
§y1: f32
Implementations§
source§impl Rect
impl Rect
pub const INF: Self = _
pub const fn new(x0: f32, y0: f32, x1: f32, y1: f32) -> Self
pub fn is_empty(&self) -> bool
pub fn contains(&self, x: f32, y: f32) -> bool
pub fn width(&self) -> f32
pub fn height(&self) -> f32
pub fn origin(&self) -> Point
pub fn size(&self) -> Size
pub fn union(&mut self, other: Rect) -> &mut Self
pub fn adjust_for_stroke( &self, stroke: &StrokeState, ctm: &Matrix ) -> Result<Self, Error>
Trait Implementations§
source§impl PartialEq for Rect
impl PartialEq for Rect
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 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