Core guide

Stroke options

Keep path stroke thickness stable or choose explicit endpoint and corner styles.

Live example

See Stroke options in action

Compare round endpoints and corners with a screen-space overlay stroke.

live rendering loading ticks 0

How it works

Path strokes use world units, butt caps, and miter joins by default. Opt into screen units, square or round caps, bevel or round joins, and a finite miter limit without managing GPU resources.

Public types

  • StrokeDraw
  • StrokeUnits
  • StrokeCap
  • StrokeJoin

Minimum viable example

typescript
frame.draw_commands([{ kind: "stroke", draw: { subpaths: outline, width: 2, units: "screen", cap: "round", join: "round", color: rgba(1, 1, 0, 1) } }]);

Scope and limitations

Options currently apply to path stroke commands; dashed strokes, inside/outside alignment, and primitive outline styles remain deferred.