pub struct Region { /* private fields */ }
Expand description
A union of rectangles, useful for describing an area that needs to be repainted.
Implementations§
Source§impl Region
impl Region
Sourcepub fn bounding_box(&self) -> Rect
pub fn bounding_box(&self) -> Rect
Returns a rectangle containing this region.
Sourcepub fn intersects(&self, rect: Rect) -> bool
pub fn intersects(&self, rect: Rect) -> bool
Returns true
if this region has a non-empty intersection with the given rectangle.
Sourcepub fn contains(&self, point: Point) -> bool
pub fn contains(&self, point: Point) -> bool
Returns true
if the given point
is contained within any rectangle in the region.
Sourcepub fn to_bez_path(&self) -> BezPath
pub fn to_bez_path(&self) -> BezPath
Converts into a Bezier path. Note that this just gives the concatenation of the rectangle paths, which is not the smartest possible thing. Also, it’s not the right answer for an even/odd fill rule.
Sourcepub fn union_with(&mut self, other: &Region)
pub fn union_with(&mut self, other: &Region)
Modifies this region by including everything in the other region.
Sourcepub fn intersect_with(&mut self, rect: Rect)
pub fn intersect_with(&mut self, rect: Rect)
Modifies this region by intersecting it with the given rectangle.
Trait Implementations§
Source§impl AddAssign<Vec2> for Region
impl AddAssign<Vec2> for Region
Source§fn add_assign(&mut self, rhs: Vec2)
fn add_assign(&mut self, rhs: Vec2)
Performs the
+=
operation. Read moreAuto Trait Implementations§
impl Freeze for Region
impl RefUnwindSafe for Region
impl Send for Region
impl Sync for Region
impl Unpin for Region
impl UnwindSafe for Region
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, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
Source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.