pub struct DirtyRegion { /* private fields */ }
Expand description
A region composed of a few rectangles that need to be redrawn.
Implementations§
Source§impl DirtyRegion
impl DirtyRegion
Sourcepub fn iter(&self) -> impl Iterator<Item = Box2D<Coord, LogicalPx>> + '_
pub fn iter(&self) -> impl Iterator<Item = Box2D<Coord, LogicalPx>> + '_
An iterator over the part of the region (they can overlap)
Sourcepub fn add_rect(&mut self, rect: LogicalRect)
pub fn add_rect(&mut self, rect: LogicalRect)
Add a rectangle to the region.
Note that if the region becomes too complex, it might be simplified by being bigger than the actual union.
Sourcepub fn add_box(&mut self, b: Box2D<Coord, LogicalPx>)
pub fn add_box(&mut self, b: Box2D<Coord, LogicalPx>)
Add a box to the region
Note that if the region becomes too complex, it might be simplified by being bigger than the actual union.
Sourcepub fn union(&self, other: &Self) -> Self
pub fn union(&self, other: &Self) -> Self
Make an union of two regions.
Note that if the region becomes too complex, it might be simplified by being bigger than the actual union
Sourcepub fn bounding_rect(&self) -> LogicalRect
pub fn bounding_rect(&self) -> LogicalRect
Bounding rectangle of the region.
Sourcepub fn intersection(&self, other: LogicalRect) -> DirtyRegion
pub fn intersection(&self, other: LogicalRect) -> DirtyRegion
Intersection of a region and a rectangle.
Trait Implementations§
Source§impl Clone for DirtyRegion
impl Clone for DirtyRegion
Source§fn clone(&self) -> DirtyRegion
fn clone(&self) -> DirtyRegion
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DirtyRegion
impl Debug for DirtyRegion
Source§impl Default for DirtyRegion
impl Default for DirtyRegion
Source§fn default() -> DirtyRegion
fn default() -> DirtyRegion
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DirtyRegion
impl RefUnwindSafe for DirtyRegion
impl Send for DirtyRegion
impl Sync for DirtyRegion
impl Unpin for DirtyRegion
impl UnwindSafe for DirtyRegion
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