Documentation menu

Interface

DrawingToolJs

A drawing tool for Drawings.register.

Properties

NameTypeDescription
anchorCountnumber | { open: number; } | 'freehand'

How it is created: a number (1–64) of clicks; { open: min }, one click per anchor until a double click or Enter, at least min (1–64) anchors; 'freehand', press, drag and release (an anchor every 3 CSS px, no handles).

Methods

build

hitTest

hitTest?(ctx: DrawingToolCtx, point: {
    x: number;
    y: number;
}): boolean | number;

true: the drawing is hit; a number: that handle (anchor); false: not hit. Default: hit inside the drawn bounds.

Declaration

export interface DrawingToolJs {
    anchorCount: number | {
        open: number;
    } | 'freehand';
    build(ctx: DrawingToolCtx): PluginCommand[];
    hitTest?(ctx: DrawingToolCtx, point: {
        x: number;
        y: number;
    }): boolean | number;
}

Used by

Drawings