@mocanvas/mocanvas · interface

StrokeOptions

interface StrokeOptions

Everything the stroke pipeline can be tuned by.


Properties · 9

easing?: (pressure: number) => number

Reshapes how pressure maps to width.

end?: StrokeTerminalOptions

Shaping for the end of the stroke.

last?: boolean

Whether these are the final points of the stroke, rather than a live prefix.

simulatePressure?: boolean

Derive pressure from speed when the input device reports none.

size?: number

The base width of the stroke, in the points' own units.

smoothing?: number

How strongly the width is averaged along the stroke, 0–1.

start?: StrokeTerminalOptions

Shaping for the start of the stroke.

streamline?: number

How strongly the input points are pulled towards the previous one, 0–1.

thinning?: number

How much pressure changes the width, 0–1. Negative inverts it.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.