#[non_exhaustive]pub enum PathCommand {
MoveTo(Point),
LineTo(Point),
QuadCurveTo {
control: Point,
end: Point,
},
CubicCurveTo {
c1: Point,
c2: Point,
end: Point,
},
ArcTo {
rx: f32,
ry: f32,
x_axis_rot: f32,
large_arc: bool,
sweep: bool,
end: Point,
},
Close,
}Expand description
A single path-construction command.
Marked #[non_exhaustive] so smooth-curve / Bezier-shorthand
variants can be added later without breaking match arms.
Note on ArcTo: SVG and PDF both accept elliptic-arc segments in
their path syntax (SVG A command, PDF via cubic approximation in
the writer). We keep the variant in the round-1 IR — converting an
arc to its spec-correct cubic-Bezier flattening is a pure function
of the arc parameters that downstream rasterizers / writers can do
independently.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MoveTo(Point)
Start a new subpath at the given point (SVG M).
LineTo(Point)
Straight line from the current point to the given point (SVG L).
QuadCurveTo
Quadratic Bezier segment from the current point (SVG Q).
CubicCurveTo
Cubic Bezier segment from the current point (SVG C).
Fields
ArcTo
SVG A-style elliptic arc segment. x_axis_rot is in radians
(consistent with Transform2D::rotate); large_arc / sweep
match the SVG flag semantics.
Fields
Close
Close the current subpath with a straight line back to its
starting point (SVG Z).
Trait Implementations§
Source§impl Clone for PathCommand
impl Clone for PathCommand
Source§fn clone(&self) -> PathCommand
fn clone(&self) -> PathCommand
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more