OptionalangleOptionaldefaultMerged under the caller's style when a drawing is created.
OptionaldefaultMerged under the caller's text when a drawing is created. The text tool uses it for its placeholder content and default size; a shape leaves it unset so it carries no label until the user gives it one.
OptionalfreehandSample the cursor continuously while the pointer is held, and finish on
release: one press-drag-release gesture is one stroke. Brushes want this;
without it a points: 0 tool collects a vertex per click, which is
polyline behaviour and never terminates on its own.
Anchors the tool needs before it is complete. 0 means free-form: the
drawing finishes on double-click.
OptionalsettingsThe fields a settings panel offers for this tool. Every built-in declares one; a custom tool without it gets the plain line fields.
OptionalshortcutKeyboard shortcut that arms this tool, as 'Alt+T' / 'Shift+Alt+F':
modifiers in Ctrl, Alt, Shift order, then a single key. Hosts render
it beside the tool's name in a palette and bind it with
matchDrawingShortcut; the library itself installs no listener, since only
the host knows whether the chart has focus or a dialog is open.
OptionalviewportThe tool can be anchored to the viewport (Drawing.space). Declare it
only when draw and distance read the screen anchors (pts) and never
drawing.points, which is empty in that space, and when nothing the tool
prints is a price or a time: a label that reads the axis under a pinned
shape would change every time the chart panned. expand, constrain and
alertValue apply to data space only.
OptionalalertNamed boundaries or active rungs, for a host's explicit level selector.
OptionalalertOpt in only when the geometry defines a numeric level or band at one time.
Optionallevel: stringOptionalboundsThe box the drawing covers at pts, its anchors in media px (the space
of HitContext). A drawing anchored to the viewport is always
painted, hit-tested and moved with this box inside its pane's plot, so it
can be seen and grabbed at every edge and after the chart resizes, and no
drag, nudge or handle can take it out. Declare it on a viewport tool
that paints beyond its anchors, as the text note and the table do from
their one corner, and the rectangle and the ellipse do for a label above
them or wider than they are; without it the box is the anchors' own
bounds. A handle dragged toward an edge the box reaches first stops short
of it, so the other anchors stay where they are.
OptionalconstrainKeep the anchors consistent after one of them moves: a handle drag
(handle is its index) or a patch to points (handle is null). Returns
the anchors to store. The position tools use it to keep the stop and the
target on opposite sides of the entry, so dragging the stop up through
the entry of a long turns the trade into a short instead of piling both
levels on one side. Pure: the same input always yields the same output.
Distance in media px from the cursor to the shape, or null for a miss.
Return 0 for "inside" so a filled region is grabbable anywhere.
OptionalexpandTurn the anchors actually clicked into the full anchor set. Lets a tool drop a complete, immediately editable default from fewer clicks: the position tools place a 1:1 box off a single click, which the user then drags, rather than demanding entry/target/stop be clicked in turn.
The returned points become the drawing's anchors, so each one stays a draggable handle.
Hold Shift to snap the free end of a two-anchor tool to 45 degree steps on screen, while placing and while dragging a handle. The line family sets it; a tool whose second anchor is not the far end of a line (a rectangle's opposite corner) leaves it off, since a locked diagonal is not what Shift means there.