@mocanvas/editor · interface
interface TLIndicatorPathA composed indicator: an outline, an optional hole punched in it, and extra strokes drawn outside that hole.
The three parts exist because a container's outline usually has to make room for something drawn over it — a frame's name strip, a section's heading. The compositor draws them in this order:
1. clipPath is installed as an **even-odd** clip. An outer rectangle plus a
label rectangle therefore clips to "everything except the label", so the
part of the outline that would run behind the label is not painted.
2. path is stroked inside that clip.
3. additionalPaths are stroked with the clip removed, so a util can draw
the box *around* the label it just punched out.
Properties · 4
additionalPaths?: Path2D[]Strokes drawn after path, with no clip.
clipPath?: Path2DAn even-odd clip applied before path is stroked.
lineDash?: readonly number[]Dash pattern for the whole indicator, **in CSS pixels** — so it stays the same on screen at every zoom, exactly like the stroke width. Omit for a continuous stroke.
SEMANTICS-ASSUMED: a mocanvas addition, not part of the v5 shape. The old
SVG indicators could set stroke-dasharray for themselves (a group's
outline does); moving paint into the compositor took that away, and this
gives it back without letting a util set colours or widths it should not
own. A util that never sets it behaves exactly as the v5 model describes.
path: Path2DThe outline, stroked under clipPath. Shape-local coordinates.
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.