Skip to content

Documentation / @finchart/tools / DrawingHandle

Interface: DrawingHandle ​

Defined in: tools/src/tools.ts:131

One drawing's handle. read is a copy — the current value with any drag reflected.

Methods ​

read() ​

read(): Drawing

Defined in: tools/src/tools.ts:132

Returns ​

Drawing


remove() ​

remove(): void

Defined in: tools/src/tools.ts:134

Safe to call twice.

Returns ​

void


update() ​

update(patch): void

Defined in: tools/src/tools.ts:152

Patches the drawing's own fields — geometry, style, levels, levelSpacing — through the same normalizer every door uses. Identity is preserved: the object in the list is written in place, so every handle, the selection, and a save recipe keep working.

A key present with undefined means "back to the default" — the documented way to return style to the theme. type and id can't be patched. An unfit patch throws and leaves the drawing untouched.

If the drawing is mid-drag when this arrives, the gesture is committed at its current position first, then the patch applies — the same rule as removing a mid-drag drawing (an outside change ends the gesture; it never silently loses your edit to the next pointermove or an Esc).

Parameters ​

patch ​

DrawingUpdate

Returns ​

void