createAnnotation.toolkit#setMode¶
Summary¶
createAnnotation.toolkit#setMode changes annotation interaction mode. A real mode change clears staged anchors and staging listeners observe the new mode with an empty pending list. Setting the current mode again is a no-op and does not clear staging.
Syntax¶
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
mode |
AnnotationMode |
Yes | Target interaction mode: idle, marker, distance, or angle. |
Returns¶
this - Returns the same toolkit.
Type Details¶
Example¶
const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);
const toolkit = wgpu.createAnnotation.toolkit({ canvas });
toolkit.setMode("distance");