pub struct BackgroundBrush {
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
pub paint: Paint,
pub repeat: BackgroundRepeat,
pub tile_width: f32,
pub tile_height: f32,
}Expand description
One background layer, as CSS draws a background-image with its position, size and
repeat: a brush laid into a rectangle of the node, in dp from its top left corner, and
repeated from there. A gradient is measured against the rectangle, not the node. The
layer is cut to the node’s outline and painted over its background colour.
Fields§
§x: f32§y: f32§width: f32§height: f32§paint: Paint§repeat: BackgroundRepeat§tile_width: f32How far apart the copies are, in dp. The rectangle’s own size is CSS repeat.
tile_height: f32Implementations§
Source§impl BackgroundBrush
impl BackgroundBrush
Sourcepub const fn new(x: f32, y: f32, width: f32, height: f32, paint: Paint) -> Self
pub const fn new(x: f32, y: f32, width: f32, height: f32, paint: Paint) -> Self
One copy of paint in the rectangle, not repeated.
Sourcepub const fn repeat(self, repeat: BackgroundRepeat) -> Self
pub const fn repeat(self, repeat: BackgroundRepeat) -> Self
Repeats the rectangle the given ways, a rectangle’s size apart unless
BackgroundBrush::step says otherwise.
Trait Implementations§
Source§impl Clone for BackgroundBrush
impl Clone for BackgroundBrush
impl Copy for BackgroundBrush
Source§impl Debug for BackgroundBrush
impl Debug for BackgroundBrush
Source§impl PartialEq for BackgroundBrush
impl PartialEq for BackgroundBrush
impl StructuralPartialEq for BackgroundBrush
Auto Trait Implementations§
impl Forget for BackgroundBrush
impl Freeze for BackgroundBrush
impl Move for BackgroundBrush
impl RefUnwindSafe for BackgroundBrush
impl Send for BackgroundBrush
impl Sync for BackgroundBrush
impl Unpin for BackgroundBrush
impl UnsafeUnpin for BackgroundBrush
impl UnwindSafe for BackgroundBrush
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