pub enum PathCommand {
MoveTo(f32, f32),
LineTo(f32, f32),
QuadTo(f32, f32, f32, f32),
CubicTo(f32, f32, f32, f32, f32, f32),
Close,
}Expand description
A single drawing command inside a [Path].
The command set is deliberately minimal and flat: every curve is
expressed in its own primitive form, and flattening to line segments
happens later, in [tess]. Keeping curves symbolic in the command
buffer means a stroke can be expanded with a different flattening
tolerance than a fill without rebuilding the path.
Every variant carries data, and #[derive(Default)] needs one
without any, so this enum has no default.
Variants§
MoveTo(f32, f32)
Starts a new sub-path at the given point.
A MoveTo implicitly closes any sub-path that is still open, which
matches the SVG filling rule: every sub-path is treated as closed
when it is filled, whether or not it was explicitly closed.
LineTo(f32, f32)
Appends a straight line segment to the current point.
QuadTo(f32, f32, f32, f32)
Appends a quadratic Bézier segment.
The first pair is the control point, the second pair is the endpoint.
CubicTo(f32, f32, f32, f32, f32, f32)
Appends a cubic Bézier segment.
The first two pairs are the control points, the third pair is the endpoint.
Close
Closes the current sub-path with a straight line back to its start.