pub enum ShapeItem {
Group {
items: Vec<ShapeItem>,
transform: ShapeTransform,
},
Rectangle(RectangleGeometry),
Ellipse(EllipseGeometry),
Polystar(PolystarGeometry),
Path(PathGeometry),
Fill {
paint: Animated<Paint>,
opacity: Animated<f32>,
rule: FillRule,
},
Stroke(StrokeItem),
Trim(TrimItem),
}Expand description
One entry of a shapes generator’s content tree.
A group is read front to back. Geometry accumulates in its group; a fill or a stroke paints the geometry listed before it in the same group, nested groups before it included; a trim cuts that geometry and replaces it. A paint listed earlier is drawn on top of one listed later, as in After Effects and Lottie.
Variants§
Group
Items drawn together, through one transform and opacity. Their geometry also counts as the enclosing group’s, for the paints and trims after the group.
Fields
transform: ShapeTransformWhere the group lies, and how opaque it is.
Rectangle(RectangleGeometry)
A rectangle, optionally with rounded corners.
Ellipse(EllipseGeometry)
An ellipse.
Polystar(PolystarGeometry)
A regular polygon or star.
Path(PathGeometry)
A Bezier path.
Fill
Paints the inside of the geometry listed before it in its group, all
of it as one compound path under rule. An open path is closed for
it.
Fields
Stroke(StrokeItem)
Strokes the geometry listed before it in its group.
Trim(TrimItem)
Keeps part of the geometry listed before it in its group, by length.