canvaskit-wasm 0.39
build 2026-04-29
StrokeOpts
A plain JS options object passed to path.stroke(opts). The method modifies the path in place to its outline — turning a polyline into the closed shape of its stroked outline. Useful when you want a Path that is the stroke (for boolean ops, hit-testing, or further effects).
const opts = {
width: 6,
cap: CK.StrokeCap.Round,
join: CK.StrokeJoin.Round,
miter_limit: 4,
precision: 1,
};
path.stroke(opts);
Fields
| Field | Type | Notes |
|---|---|---|
width | number | Stroke width. |
cap | StrokeCap | End caps for open subpaths. |
join | StrokeJoin | Corner joins. |
miter_limit | number | Miter cutoff ratio (when join = Miter). |
precision | number | Curve flattening tolerance. Lower = finer subdivision. |
See also
Path—path.stroke(opts)consumes this.StrokeCap,StrokeJoin.