pub struct Stamp {
pub shape: Shape,
pub at: Vec<Point>,
pub paint: Paint,
pub stroke: Option<StrokeStyle>,
}Expand description
The payload of DrawOp::Stamp: one shape drawn at every position in at.
A scatter plot is the case this exists for. Drawn as individual ops, fifty thousand points are
fifty thousand DrawOps, rebuilt, compared and cloned on every frame that re-records, before
a backend draws anything. As one Stamp they are one op and a flat array of coordinates, and
a backend can put every copy into one path and hand the rasterizer a single fill.
Every copy shares the shape, the size and the paint. Varying any of those means more than one stamp: group by what varies, which for a chart is usually the series color.
Fields§
§shape: ShapeThe template, authored around the origin: each copy is this shape translated by one point.
A 6-point dot is Shape::Ellipse(Rect::new(-3.0, -3.0, 6.0, 6.0)).
at: Vec<Point>Where the copies go. Order is the drawing order, so later points paint over earlier ones.
paint: Paint§stroke: Option<StrokeStyle>None fills each copy; Some strokes it with this style.