Stroke
class Stroke
An immutable stroke. Create strokes with Drawing.addStroke or by drawing on a canvas.
| Member | Type | Description |
|---|---|---|
id | number | Unique within the process; not persisted by serialization. |
ink | Ink | The stroke's ink. |
bounds | Rect | Bounds of the rendered stroke in content points. |
pointCount | number | Number of points; at least 1. |
getPoints() | StrokePoint[] | Copies the stroke's points. |
All members are read-only. To change a stroke, remove it and add a new one, or recolour it through a selection.
for (const stroke of drawing.getStrokes()) {
console.log(stroke.id, stroke.ink.type, stroke.pointCount)
}