drawing::path
Structs
Path
A 2D vector path for arbitrary Bézier and line-segment chains.
elements describes the path in local coordinates. fill paints the
interior of closed contours, while stroke paints the path itself; for
open subpaths, the stroke cap controls the exposed endpoints. Fills use
non-zero winding: overlapping contours with the same direction
stay filled; reverse an inner contour's direction to create a hole.
Path geometry may draw outside the element's layout bounds; use a Frame or Mask when
that overflow should be clipped.
Properties
elements
Type: Property<Vec<PathElement>>
The path commands and control points, expressed in local coordinates.
stroke
Type: Property<Vec<Stroke>>
The stroke applied along the path centerline.
fill
Type: Property<Vec<Fill>>
The fill applied to the interior of closed contours.
smoothing
Type: Property<PathSmoothing>
Optional curve smoothing applied before rendering path geometry.
draw_start
Type: Property<UnitValue>
Start position of the visible stroke range over the path's total length.
draw_end
Type: Property<UnitValue>
End position of the visible stroke range over the path's total length.
Implementations
curve_to
pub fn curve_to(path: Vec<PathElement>, h_x: Size, h_y: Size, x: Size, y: Size) -> Vec<PathElement>
Appends a quadratic Bézier curve with one control point.
line_to
pub fn line_to(path: Vec<PathElement>, x: Size, y: Size) -> Vec<PathElement>
Appends a straight line segment to the provided point.
start
pub fn start(x: Size, y: Size) -> Vec<PathElement>
Starts a new path at the provided point.
PathClose
Path child component that closes the current contour.
PathCurve
Path child component that inserts a quadratic curve control point.
Properties
x
Type: Property<Size>
Control point x-coordinate.
y
Type: Property<Size>
Control point y-coordinate.
PathLine
Path child component that inserts a straight line segment.
PathPoint
Path child component that inserts a PathElement::Point.
Properties
x
Type: Property<Size>
Point x-coordinate.
y
Type: Property<Size>
Point y-coordinate.