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

FieldTypeNotes
widthnumberStroke width.
capStrokeCapEnd caps for open subpaths.
joinStrokeJoinCorner joins.
miter_limitnumberMiter cutoff ratio (when join = Miter).
precisionnumberCurve flattening tolerance. Lower = finer subdivision.

See also