Path and vector API
Declared by <huxerui/vector.h>.
Copy-on-write contour value. Mutating chain methods are MoveTo, LineTo, QuadraticTo, CubicTo, ArcTo, and Close; Reset clears it. RoundedRect(rect, radii) creates a path. Queries are IsEmpty, Bounds, and equality.
Path options
Section titled “Path options”PathFillRule:NonZero,EvenOdd.StrokeCap:Butt,Round,Square.StrokeJoin:Miter,Round,Bevel.
VectorAsset
Section titled “VectorAsset”Create(intrinsic_size, build) uses an implicit view box; Create(view_box, intrinsic_size, build) sets both. Queries are ViewBox, IntrinsicSize, HasValue, and handle equality.
VectorBuilder
Section titled “VectorBuilder”Available only inside VectorAsset::Create. Methods: FillPath, StrokePath (Brush and StrokeStyle), PushClip, PopClip, PushTransform, and PopTransform. Clips and transforms must balance before the build callback returns.
Validation and selection
Section titled “Validation and selection”Path uses copy-on-write storage, so copying a value is cheap until one copy mutates.
VectorAsset is immutable after its build callback and can be shared by Image, image fills, and paint commands.
Invalid sizes, unbalanced clips/transforms, and invalid stroke geometry are rejected when the asset is built.
Use Path directly for size-dependent Canvas drawing and clipping.
Use VectorAsset for stable reusable artwork with an intrinsic size and view box.
Use ImageResource when the resource compiler owns the vector source and configuration lookup.
Arcs, hit tests, and stroke style
Section titled “Arcs, hit tests, and stroke style”Path::ArcTo(radii, x_axis_rotation, ArcSize, ArcDirection, end) uses endpoint-based elliptical geometry; rotation is in radians. Zero radii reduce to a line, equal endpoints produce no segment, and undersized radii are scaled to reach the endpoint. Use two arcs to describe a full ellipse. Contains(point, fill_rule) tests filled geometry, not its stroke or an automatically installed View hit region.
StrokeStyle groups width, cap, join, miter limit, dash pattern, and dash offset. Values must be finite; width/dash lengths are nonnegative and miter limit is at least one. An all-zero pattern is solid; offsets wrap into the dash cycle.
FillPath(path, brush[, brush_bounds], rule) and StrokePath(path, brush[, brush_bounds], style) accept a Brush. Explicit brush bounds map gradient sampling without clipping the geometry. Include <huxerui/paint.h> when constructing Brush or gradients.

