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 withclose().resScale: number— sampling resolution; higher gives more accurate length measurements at higher cost.1is reasonable.
Members
| Member | Args | Returns | Notes |
|---|---|---|---|
delete | — | void | Free the WASM memory. |
next | — | ContourMeasure | null | Advance to the next contour, or null when done. Caller deletes the returned ContourMeasure. |
See also
ContourMeasure— whatnext()returns.Path.