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 stroke paints the geometry listed before it in the same group (nested groups included), and a trim cuts and replaces that geometry. Earlier paints draw on top of later ones, 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 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, as one compound path
under rule. Open paths are 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.