Skip to main content

Interface: StrokeMessage

Defined in: src/lib/messages/schema.ts:57

A finished brush or eraser stroke, with everything needed to draw it again

Extends​

  • BaseCanvasMessage

Properties​

colour​

colour: string

Defined in: src/lib/messages/schema.ts:69

Paint colour as #rrggbb


isPen​

isPen: boolean

Defined in: src/lib/messages/schema.ts:71

Whether input came from a pen (pressure and tilt apply)


layer​

layer: string

Defined in: src/lib/messages/schema.ts:62

ID of the sender's layer it was drawn on


mode​

mode: "paint" | "erase"

Defined in: src/lib/messages/schema.ts:63


points​

points: TimedStrokePoint[]

Defined in: src/lib/messages/schema.ts:75

Input points, in order


preset​

preset: BrushConfig

Defined in: src/lib/messages/schema.ts:65

Brush settings


protocol​

protocol: 2

Defined in: src/lib/messages/schema.ts:37

Protocol version (PROTOCOL_VERSION)

Inherited from​

BaseCanvasMessage.protocol


seed​

seed: number

Defined in: src/lib/messages/schema.ts:73

Seed for the stroke's random variation, so it draws the same again


size​

size: object

Defined in: src/lib/messages/schema.ts:67

Size chosen by the user

height​

height: number

width​

width: number


step​

step: string

Defined in: src/lib/messages/schema.ts:60

The history step the stroke made (see undo and redo messages)


type​

type: "stroke"

Defined in: src/lib/messages/schema.ts:58