Interface: PointsEditorInstance
Defined in: dom/src/points-editor/index.ts:97
Properties
beginPointDrag
beginPointDrag: (id, modifiers) => void;
Defined in: dom/src/points-editor/index.ts:117
A pointer went down on a point: work out the new selection and remember where everything the drag picked up started.
Ctrl / meta add the point to the selection or take it out: shift is the fine-adjustment key on every control here, and it cannot be both. A press on a point already selected keeps the selection, so the group can be dragged.
Parameters
| Parameter | Type |
|---|---|
id | string |
modifiers | ModifierState |
Returns
void
beginSelectionBox
beginSelectionBox: (at, modifiers) => void;
Defined in: dom/src/points-editor/index.ts:152
A drag on empty space started at at: start a selection box there.
Parameters
| Parameter | Type |
|---|---|
at | PointPosition |
modifiers | ModifierState |
Returns
void
destroy
destroy: () => void;
Defined in: dom/src/points-editor/index.ts:160
Returns
void
endSelectionBox
endSelectionBox: () => void;
Defined in: dom/src/points-editor/index.ts:159
End the selection box. The press that started it left the focus on nothing, and the arrow keys and the wheel reach a point only through the focus, so it is handed to one of the points the box selected.
Returns
void
isPointElement
isPointElement: (element) => boolean;
Defined in: dom/src/points-editor/index.ts:107
Whether the element is a point, or inside one.
Parameters
| Parameter | Type |
|---|---|
element | Element | null | undefined |
Returns
boolean
movePointDrag
movePointDrag: (delta) => void;
Defined in: dom/src/points-editor/index.ts:122
Move everything the drag picked up by delta from where it started,
stopping the whole group together at the edge.
Parameters
| Parameter | Type |
|---|---|
delta | PointPosition |
Returns
void
moveSelectionBox
moveSelectionBox: (to) => void;
Defined in: dom/src/points-editor/index.ts:153
Parameters
| Parameter | Type |
|---|---|
to | PointPosition |
Returns
void
nudgeFocusedPoint
nudgeFocusedPoint: (axis, direction, modifiers) => boolean;
Defined in: dom/src/points-editor/index.ts:146
Move the point holding the focus by one wheel notch, with its own wheel option. The wheel is listened to once for the whole editor, since a wheel event only reaches what the cursor is over. Returns whether a point took it, so the caller knows whether to consume the event.
Parameters
| Parameter | Type |
|---|---|
axis | "x" | "y" |
direction | number |
modifiers | ModifierState |
Returns
boolean
nudgePoint
nudgePoint: (id, axis, direction, option, modifiers?) => void;
Defined in: dom/src/points-editor/index.ts:133
Move id by one press of option along one axis, taking the selection
along as PointsEditorInstance.nudgeSelection does.
Parameters
| Parameter | Type |
|---|---|
id | string |
axis | "x" | "y" |
direction | number |
option | ModifierValue<InputEventOption> |
modifiers? | ModifierState |
Returns
void
nudgeSelection
nudgeSelection: (id, delta) => void;
Defined in: dom/src/points-editor/index.ts:128
Move id — and the selection, when it is part of one — by delta from
where the points are now: an input that is not a drag has no earlier
position to measure against.
Parameters
| Parameter | Type |
|---|---|
id | string |
delta | PointPosition |
Returns
void
registerPoint
registerPoint: (id, read) => () => void;
Defined in: dom/src/points-editor/index.ts:105
Register a point under id. read is called whenever the editor needs
the point, so it can return what the point is now rather than what it
was when it registered. Returns the function that unregisters it.
Parameters
| Parameter | Type |
|---|---|
id | string |
read | () => PointsEditorPoint |
Returns
() => void
update
update: (options) => void;
Defined in: dom/src/points-editor/index.ts:99
Replace the given options.
Parameters
| Parameter | Type |
|---|---|
options | Partial<PointsEditorOptions> |
Returns
void