pub struct BBox { /* private fields */ }Expand description
Bounding box with sides directed along the axes
Implementations§
Source§impl BBox
impl BBox
Sourcepub fn new(p0: impl Into<Point>, p1: impl Into<Point>) -> BBox
pub fn new(p0: impl Into<Point>, p1: impl Into<Point>) -> BBox
Construct bounding box which includes points p0 and p1
Sourcepub fn contains(&self, point: Point) -> bool
pub fn contains(&self, point: Point) -> bool
Determine if the point is inside of the bounding box
Sourcepub fn extend(&self, point: Point) -> BBox
pub fn extend(&self, point: Point) -> BBox
Extend bounding box so it would contains provided point
pub fn union_opt(&self, other: Option<BBox>) -> BBox
Sourcepub fn intersect(&self, other: BBox) -> Option<BBox>
pub fn intersect(&self, other: BBox) -> Option<BBox>
Find bounding box of the intersection of two bounding boxes
Sourcepub fn unit_transform(&self) -> Transform
pub fn unit_transform(&self) -> Transform
Transform that makes bounding box a unit-sized square
This is used by clip|mask|gradient units
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BBox
impl<'de> Deserialize<'de> for BBox
Source§fn deserialize<D>(
deserializer: D,
) -> Result<BBox, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<BBox, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for BBox
impl Serialize for BBox
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for BBox
impl StructuralPartialEq for BBox
Auto Trait Implementations§
impl Freeze for BBox
impl RefUnwindSafe for BBox
impl Send for BBox
impl Sync for BBox
impl Unpin for BBox
impl UnwindSafe for BBox
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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