Adapter/scene access — opaque at this layer; tools that need it cast to a known shape. This layer doesn't constrain it.
Bounding rect of the canvas element in viewport coords. Used by zoom/pan tools to convert event clientX/clientY to canvas-relative anchors.
OptionaldebugOptional debug sink. When <Canvas debug={...}> is enabled, Canvas
threads its sink here so tool-internal hit math (handle hitboxes,
rotation handle, etc.) lands in the same overlay as Canvas's own
bounds/origin records. Tools should call this conditionally with ?..
OptionalscreenScreen-space pointer coords relative to canvasRect. Useful for
viewport tools that pan/zoom in screen space (e.g. hand-pan
computes deltas in pixels, not world units). Optional — populated
by the dispatcher on pointer events; absent on keyboard events.
Mutate the viewport. In controlled mode this calls the consumer's
onViewChange; in uncontrolled mode it updates Canvas's internal
state. View changes are not undoable.
Current viewport. Reflects camera-position semantics — see
View JSDoc.
Per-event context passed to every channel handler.
scratchis typed via the tool'sTScratchparameter; it survives across a single gesture (pointer-down through end/cancel) and is replaced on next gesture start byinitScratch().