Trait substrate::geometry::union::BoundingUnion
source · pub trait BoundingUnion<T>where
T: ?Sized,{
type Output;
// Required method
fn bounding_union(&self, other: &T) -> Self::Output;
}
Expand description
Trait for calculating a shape that bounds the union of two geometric objects.
Required Associated Types§
Required Methods§
sourcefn bounding_union(&self, other: &T) -> Self::Output
fn bounding_union(&self, other: &T) -> Self::Output
Calculates the bounding union of this shape with other
.
§Example
let r1 = Rect::from_sides(0, 0, 100, 200);
let r2 = Rect::from_sides(-50, 20, 120, 160);
assert_eq!(r1.bounding_union(&r2), Rect::from_sides(-50, 0, 120, 200));
let r1 = Rect::from_sides(0, 0, 100, 200);
let r2 = None;
assert_eq!(r1.bounding_union(&r2), Rect::from_sides(0, 0, 100, 200));