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>) -> Self
pub fn new(p0: impl Into<Point>, p1: impl Into<Point>) -> Self
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) -> Self
pub fn extend(&self, point: Point) -> Self
Extend bounding box so it would contains provided point
pub fn union_opt(&self, other: Option<BBox>) -> Self
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<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for BBox
impl PartialEq for BBox
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