PathCommand
Path command constants for defining custom vector paths.Values
Closes the current path by drawing a straight line from the current position back to the starting point. Consumes 0 points.
Moves the current position to a new point without drawing. Consumes 1 point (x, y).
Draws a straight line from the current position to the specified point. Consumes 1 point (x, y).
Draws a cubic Bézier curve from the current position using two control points and an end point. Consumes 3 points (control1, control2, end).
Usage
FillRule
Fill rule constants for determining shape interiors.Values
Non-zero winding rule. Determines whether a point is inside the shape by drawing a ray from the point to infinity and counting the number of times the path crosses the ray. If the count is non-zero, the point is inside.
Even-odd rule. Determines whether a point is inside the shape by drawing a ray from the point to infinity and counting the crossings. If the count is odd, the point is inside; if even, it’s outside.
Usage
The difference between NonZero and EvenOdd is most visible in self-intersecting paths, where EvenOdd creates “holes” at intersections.
StrokeCap
Stroke cap constants for line endpoint styling.Values
Butt cap - The stroke ends exactly at the endpoint with no extension.
Round cap - The stroke extends beyond the endpoint with a rounded semicircle whose diameter equals the stroke width.
Square cap - The stroke extends beyond the endpoint with a square projection whose length equals half the stroke width.
Usage
StrokeJoin
Stroke join constants for corner styling where path segments meet.Values
Bevel join - Corners are cut off with a straight edge connecting the outer corners of the stroke.
Round join - Corners are rounded with a circular arc connecting the outer corners of the stroke.
Miter join - Corners are sharp, with the outer edges extended until they meet. Can be limited by
strokeMiterlimit.Usage
When using
StrokeJoin.Miter, you can control the maximum miter length with the strokeMiterlimit prop (default: 4). If the miter length exceeds this limit, the join is automatically converted to a bevel.