OptionalautoWhen true (default), clicking the first anchor to close a subpath commits immediately — the closed region renders with its fill right away. When false, the closed subpath stays in scratch so the user can start another subpath; commit then fires on Enter / tool-switch / ⌘-click / double-click, producing a compound path.
OptionalautoAuto-select the new object after commit. Default true.
OptionalcloseScreen-px hit radius for "click first anchor to close". Default 8.
Note: implemented in world space here (divided by view.scale at the
call site); aligns with useSelectTool.handleHitRadius.
OptionalsnapOptional point snapper applied to every world-space coordinate the
pen records or previews — anchor positions (corner clicks, smooth-
drag base point), the rubber-band cursor, and the outgoing-handle
target. Receives raw world coords; returns snapped world coords.
Wire to gridSnapStrategy-style spacing via the consumer:
snapPoint: (p) => ({
x: Math.round(p.x / SPACING) * SPACING,
y: Math.round(p.y / SPACING) * SPACING,
})
Pen state (anchor handles, etc.) is computed AFTER snapping so the visible geometry stays grid-aligned.
Wrap a finished PolygonPath in the consumer's pose type.
Insert + select adapter.