pub struct ShapeDrawParams {
pub rect: Rect,
pub local_rect: Rect,
pub quad: [[f32; 2]; 4],
pub brush: ResolvedBrush,
pub shape: Option<RoundedCornerShape>,
pub stroke: Option<Stroke>,
pub arc: Option<ArcGeometry>,
pub line: Option<LineGeometry>,
pub trapezoid: Option<Trapezoid>,
pub clip: Option<Rect>,
pub blend_mode: BlendMode,
pub motion_context_animated: bool,
}Expand description
A shape ready for a renderer to draw, with the layer transform, paint and clip resolved.
Fields§
§rect: RectAxis-aligned bounds of quad.
local_rect: RectThe shape’s rectangle after the layer’s scale and translation, before any rotation.
quad: [[f32; 2]; 4]The shape’s rectangle after the full layer transform, as four corners.
brush: ResolvedBrushLayer-resolved at emit time. Solid — effectively every shape of a
heavy animated frame — is an inline color; only gradients carry a
cloned Brush.
shape: Option<RoundedCornerShape>Rounded corners of the shape, or None for sharp corners.
stroke: Option<Stroke>Some means “stroke the outline of local_rect/shape” instead of
filling it. The width is already in local_rect units (the layer scale
has been applied), and local_rect/quad have already been inflated by
half that width so the outer half of the stroke has geometry to land on.
arc: Option<ArcGeometry>Some replaces the rect geometry entirely with a circular band. The
center and radii are in local_rect units.
line: Option<LineGeometry>Some replaces the rect geometry entirely with a stroked segment, its
ends and width in local_rect units.
trapezoid: Option<Trapezoid>Some replaces the rect geometry entirely with a slice of a path
fill, in local_rect units; local_rect is the rect its brush
resolves against.
clip: Option<Rect>Clip rectangle that cuts the shape, or None when nothing clips it.
blend_mode: BlendModeHow the shape blends onto what lies beneath it.
motion_context_animated: boolWhether the shape sits in an animated motion context, where a renderer must not snap it to the pixel grid.