Type Alias iced_tiny_skia::Primitive

source ·
pub type Primitive = Primitive<Custom>;

Aliased Type§

enum Primitive {
    Text {
        content: String,
        bounds: Rectangle,
        color: Color,
        size: Pixels,
        line_height: LineHeight,
        font: Font,
        horizontal_alignment: Horizontal,
        vertical_alignment: Vertical,
        shaping: Shaping,
        clip_bounds: Rectangle,
    },
    Paragraph {
        paragraph: Weak,
        position: Point,
        color: Color,
        clip_bounds: Rectangle,
    },
    Editor {
        editor: Weak,
        position: Point,
        color: Color,
        clip_bounds: Rectangle,
    },
    RawText(Raw),
    Quad {
        bounds: Rectangle,
        background: Background,
        border: Border,
        shadow: Shadow,
    },
    Image {
        handle: Handle,
        filter_method: FilterMethod,
        bounds: Rectangle,
        border_radius: [f32; 4],
    },
    Svg {
        handle: Handle,
        color: Option<Color>,
        bounds: Rectangle,
    },
    Group {
        primitives: Vec<Primitive<Custom>>,
    },
    Clip {
        bounds: Rectangle,
        content: Box<Primitive<Custom>>,
    },
    Translate {
        translation: Vector,
        content: Box<Primitive<Custom>>,
    },
    Cache {
        content: Arc<Primitive<Custom>>,
    },
    Custom(Custom),
}

Variants§

§

Text

A text primitive

Fields

§content: String

The contents of the text.

§bounds: Rectangle

The bounds of the text.

§color: Color

The color of the text.

§size: Pixels

The size of the text in logical pixels.

§line_height: LineHeight

The line height of the text.

§font: Font

The font of the text.

§horizontal_alignment: Horizontal

The horizontal alignment of the text.

§vertical_alignment: Vertical

The vertical alignment of the text.

§shaping: Shaping

The shaping strategy of the text.

§clip_bounds: Rectangle

The clip bounds of the text.

§

Paragraph

A paragraph primitive

Fields

§paragraph: Weak

The [paragraph::Weak] reference.

§position: Point

The position of the paragraph.

§color: Color

The color of the paragraph.

§clip_bounds: Rectangle

The clip bounds of the paragraph.

§

Editor

An editor primitive

Fields

§editor: Weak

The [editor::Weak] reference.

§position: Point

The position of the editor.

§color: Color

The color of the editor.

§clip_bounds: Rectangle

The clip bounds of the editor.

§

RawText(Raw)

A raw cosmic-text primitive

§

Quad

A quad primitive

Fields

§bounds: Rectangle

The bounds of the quad

§background: Background

The background of the quad

§border: Border

The [Border] of the quad

§shadow: Shadow

The [Shadow] of the quad

§

Image

An image primitive

Fields

§handle: Handle

The handle of the image

§filter_method: FilterMethod

The filter method of the image

§bounds: Rectangle

The bounds of the image

§border_radius: [f32; 4]

The border radii of the image

§

Svg

An SVG primitive

Fields

§handle: Handle

The path of the SVG file

§color: Option<Color>

The [Color] filter

§bounds: Rectangle

The bounds of the viewport

§

Group

A group of primitives

Fields

§primitives: Vec<Primitive<Custom>>

The primitives of the group

§

Clip

A clip primitive

Fields

§bounds: Rectangle

The bounds of the clip

§content: Box<Primitive<Custom>>

The content of the clip

§

Translate

A primitive that applies a translation

Fields

§translation: Vector

The translation vector

§content: Box<Primitive<Custom>>

The primitive to translate

§

Cache

A cached primitive.

This can be useful if you are implementing a widget where primitive generation is expensive.

Fields

§content: Arc<Primitive<Custom>>

The cached primitive

§

Custom(Custom)

A backend-specific primitive.