Mode
Represents the current drawing mode, determining what type of element is created when the user interacts with the canvas.
Each mode maps to a specific Element type and rendering behavior:
PEN: Creates Element.Path for freehand drawing
RECTANGLE: Creates Element.Shape with ShapeType.RECTANGLE
CIRCLE: Creates Element.Shape with ShapeType.CIRCLE
TRIANGLE: Creates Element.Shape with ShapeType.TRIANGLE
ARROW: Creates Element.Shape with ShapeType.ARROW
LINE: Creates Element.Shape with ShapeType.LINE
SELECT: Selects existing elements. Tap to select, drag to move, drag a handle to resize or rotate, drag on empty space to marquee-select multiple elements.
ERASER: Tap or drag to delete elements whose body intersects the eraser radius. Whole-element (object) eraser — strokes/shapes are removed atomically.
The mode is read from State.mode and passed to DrawBox, which uses it to determine how to interpret user gestures.
Inheritors
Types
Plain-text mode — tap on the canvas inserts an empty Element.Text at the tap position. The sample app opens a modal text field to gather the actual content; embedders can mirror that pattern or provide an inline editor (out of scope for OSS v1).
Functions
Whether mode participates in State.toolMemory save/restore on Intent.SetMode.