pub struct BackgroundDraw { /* private fields */ }Expand description
What a background modifier draws: its color over the rect of its coordinator, rounded when a corner shape of the chain shapes it. It is plain data, so a renderer can keep it as one shape.
Implementations§
Source§impl BackgroundDraw
impl BackgroundDraw
Sourcepub fn shape_in(&self, size: Size) -> (Rect, Option<CornerRadii>)
pub fn shape_in(&self, size: Size) -> (Rect, Option<CornerRadii>)
The rect the background fills in a node of size, with the radii of
its corners when a corner shape rounds it.
Sourcepub fn draw(&self, scope: &mut dyn DrawScope)
pub fn draw(&self, scope: &mut dyn DrawScope)
Records the background into scope, whose size is the node’s.
Sourcepub fn record(
&self,
shape: (Rect, Option<CornerRadii>),
recorder: &mut ShapeRecorder,
)
pub fn record( &self, shape: (Rect, Option<CornerRadii>), recorder: &mut ShapeRecorder, )
Records the background into recorder as shape, which
Self::shape_in gives for the node’s size: the shape Self::draw
records into a draw scope.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for BackgroundDraw
impl !Send for BackgroundDraw
impl !Sync for BackgroundDraw
impl !UnwindSafe for BackgroundDraw
impl Forget for BackgroundDraw
impl Freeze for BackgroundDraw
impl Move for BackgroundDraw
impl Unpin for BackgroundDraw
impl UnsafeUnpin for BackgroundDraw
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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