Skip to main content

Paint

Enum Paint 

Source
pub enum Paint {
    Rect(PaintRect),
    Text(PaintText),
    Image(PaintImage),
    Tick(PaintTick),
    Shadow {
        x: f32,
        y: f32,
        width: f32,
        height: f32,
        radius: f32,
        blur: f32,
        color: Rgba,
    },
    PushClip {
        x: f32,
        y: f32,
        width: f32,
        height: f32,
        radius: Corners,
    },
    PopClip,
    PushTransform(Transform),
    PopTransform,
    PushOpacity {
        alpha: f32,
        width: f32,
        height: f32,
    },
    PopOpacity,
}
Expand description

A drawable item in painter’s order (parents before children).

Variants§

§

Rect(PaintRect)

§

Text(PaintText)

§

Image(PaintImage)

§

Tick(PaintTick)

§

Shadow

A blurred box-shadow, drawn behind its box. Geometry already has the offset and spread applied.

Fields

§width: f32
§height: f32
§radius: f32
§blur: f32
§color: Rgba
§

PushClip

Begin clipping subsequent items to this rounded rect (overflow: clip).

Fields

§width: f32
§height: f32
§radius: Corners
§

PopClip

End the most recent clip.

§

PushTransform(Transform)

Begin an affine transform on the subtree. The matrix already has the transform-origin baked in, so it applies directly to absolute coords.

§

PopTransform

End the most recent transform.

§

PushOpacity

Begin a translucent layer over the subtree (opacity). The shape is the whole viewport, so the layer fades without also clipping.

Fields

§alpha: f32
§width: f32
§height: f32
§

PopOpacity

End the most recent opacity layer.

Trait Implementations§

Source§

impl Clone for Paint

Source§

fn clone(&self) -> Paint

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Paint

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Paint

§

impl RefUnwindSafe for Paint

§

impl Send for Paint

§

impl Sync for Paint

§

impl Unpin for Paint

§

impl UnsafeUnpin for Paint

§

impl UnwindSafe for Paint

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.