#[repr(C)]pub struct Rect<T> {
pub left: T,
pub top: T,
pub right: T,
pub bottom: T,
}Expand description
Rectangle with generic numeric type Direct port from clipper.core.h line 295
Fields§
§left: T§top: T§right: T§bottom: TImplementations§
Source§impl<T> Rect<T>
impl<T> Rect<T>
Sourcepub fn new_with_validity(is_valid: bool) -> Selfwhere
T: Bounded,
pub fn new_with_validity(is_valid: bool) -> Selfwhere
T: Bounded,
Create a rectangle, valid by default or invalid if specified Direct port from clipper.core.h line 307
Sourcepub fn invalid() -> Selfwhere
T: Bounded,
pub fn invalid() -> Selfwhere
T: Bounded,
Create an invalid rectangle Direct port from clipper.core.h line 320
Sourcepub fn mid_point(&self) -> Point<T>
pub fn mid_point(&self) -> Point<T>
Get midpoint of rectangle Direct port from clipper.core.h line 336
Sourcepub fn as_path(&self) -> Path<T>
pub fn as_path(&self) -> Path<T>
Convert rectangle to path (clockwise from top-left) Direct port from clipper.core.h line 341
Sourcepub fn contains_point(&self, pt: &Point<T>) -> bool
pub fn contains_point(&self, pt: &Point<T>) -> bool
Check if point is contained within rectangle (exclusive bounds) Direct port from clipper.core.h line 352
Sourcepub fn contains_rect(&self, rec: &Rect<T>) -> bool
pub fn contains_rect(&self, rec: &Rect<T>) -> bool
Check if another rectangle is fully contained within this rectangle Direct port from clipper.core.h line 357
Sourcepub fn intersects(&self, rec: &Rect<T>) -> bool
pub fn intersects(&self, rec: &Rect<T>) -> bool
Check if this rectangle intersects with another Direct port from clipper.core.h line 372
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Check if rectangle is valid (not using max sentinel values) Direct port from clipper.core.h line 329
Sourcepub fn set_height(&mut self, height: T)
pub fn set_height(&mut self, height: T)
Set height, adjusting bottom edge
Trait Implementations§
Source§impl<T> AddAssign for Rect<T>
impl<T> AddAssign for Rect<T>
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
+= operation. Read more