canvaskit-wasm 0.39 build 2026-04-29

ContourMeasureIter

Iterator over a Path's contours. Each next() call returns a ContourMeasure for the next subpath, or null when there are no more.

ContourMeasureIter is a WASM object — .delete() when done.

const iter = new CK.ContourMeasureIter(path, false, 1);
let cm;
while ((cm = iter.next()) !== null) {
  // ...use cm...
  cm.delete();
}
iter.delete();

Constructor

new CK.ContourMeasureIter(path, forceClosed, resScale)
  • path: Path — the path to walk.
  • forceClosed: boolean — treat unclosed subpaths as if they ended with close().
  • resScale: number — sampling resolution; higher gives more accurate length measurements at higher cost. 1 is reasonable.

Members

MemberArgsReturnsNotes
deletevoidFree the WASM memory.
nextContourMeasure | nullAdvance to the next contour, or null when done. Caller deletes the returned ContourMeasure.

See also