pub type PathCommand = GenericShapeCommand<CSSFloat, CSSFloat>;
Expand description
The SVG path command. The fields of these commands are self-explanatory, so we skip the documents. Note: the index of the control points, e.g. control1, control2, are mapping to the control points of the Bézier curve in the spec.
https://www.w3.org/TR/SVG11/paths.html#PathData
Aliased Type§
enum PathCommand {
Move {
by_to: ByTo,
point: CoordinatePair<f32>,
},
Line {
by_to: ByTo,
point: CoordinatePair<f32>,
},
HLine {
by_to: ByTo,
x: f32,
},
VLine {
by_to: ByTo,
y: f32,
},
CubicCurve {
by_to: ByTo,
point: CoordinatePair<f32>,
control1: CoordinatePair<f32>,
control2: CoordinatePair<f32>,
},
QuadCurve {
by_to: ByTo,
point: CoordinatePair<f32>,
control1: CoordinatePair<f32>,
},
SmoothCubic {
by_to: ByTo,
point: CoordinatePair<f32>,
control2: CoordinatePair<f32>,
},
SmoothQuad {
by_to: ByTo,
point: CoordinatePair<f32>,
},
Arc {
by_to: ByTo,
point: CoordinatePair<f32>,
radii: CoordinatePair<f32>,
arc_sweep: ArcSweep,
arc_size: ArcSize,
rotate: f32,
},
Close,
}
Variants§
Move
The move command.
Line
The line command.
HLine
The hline command.
VLine
The vline command.
CubicCurve
The cubic Bézier curve command.
QuadCurve
The quadratic Bézier curve command.
SmoothCubic
The smooth command.
SmoothQuad
The smooth quadratic Bézier curve command.
Arc
The arc command.
Close
The closepath command.
Implementations§
source§impl PathCommand
impl PathCommand
sourcefn normalize(&self, state: &mut PathTraversalState) -> Self
fn normalize(&self, state: &mut PathTraversalState) -> Self
Create a normalized copy of this PathCommand. Absolute commands will be copied as-is while for relative commands an equivalent absolute command will be returned.
See discussion: https://github.com/w3c/svgwg/issues/321
sourcefn to_css_for_svg<W>(&self, dest: &mut CssWriter<'_, W>) -> Resultwhere
W: Write,
fn to_css_for_svg<W>(&self, dest: &mut CssWriter<'_, W>) -> Resultwhere
W: Write,
The serialization of the svg path.