pub struct Box2 {
pub x0: f64,
pub y0: f64,
pub x1: f64,
pub y1: f64,
}Expand description
An axis-aligned rectangle in device space, x0 <= x1, y0 <= y1.
Fields§
§x0: f64§y0: f64§x1: f64§y1: f64Implementations§
Source§impl Box2
impl Box2
pub fn new(x0: f64, y0: f64, x1: f64, y1: f64) -> Box2
pub fn intersect(self, o: Box2) -> Box2
pub fn is_empty(self) -> bool
pub fn width(self) -> f64
pub fn height(self) -> f64
Sourcepub fn transformed(self, m: Mat) -> Box2
pub fn transformed(self, m: Mat) -> Box2
The four corners of [x0 y0 x1 y1] under m, as a bounding box.
Trait Implementations§
impl Copy for Box2
impl StructuralPartialEq for Box2
Auto Trait Implementations§
impl Freeze for Box2
impl RefUnwindSafe for Box2
impl Send for Box2
impl Sync for Box2
impl Unpin for Box2
impl UnsafeUnpin for Box2
impl UnwindSafe for Box2
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more