gestures/canvas#

Classes#

CanvasPointer#

Defined in: arranger/src/gestures/canvas.ts:66

The canvas’s pointer handlers, each bound to the canvas it was made for.

Constructors#

Constructor#

new CanvasPointer(host): CanvasPointer

Defined in: arranger/src/gestures/canvas.ts:76

Parameters#
host#

PointerHost

Returns#

CanvasPointer

Methods#

clicked()#

clicked(address, event): Selection

Defined in: arranger/src/gestures/canvas.ts:95

The selection after a click on address: Shift, or the marquee toggle, adds or removes.

Parameters#
address#

Address | null

event#
shiftKey#

boolean

Returns#

Selection

dblclick()#

readonly dblclick(event): void

Defined in: arranger/src/gestures/canvas.ts:190

A double-click opens what it hit, or outside the edited element closes the innermost editor.

Parameters#
event#

MouseEvent

Returns#

void

nodeclick()#

readonly nodeclick(__namedParameters): void

Defined in: arranger/src/gestures/canvas.ts:136

Parameters#
__namedParameters#
event#

MouseEvent | TouchEvent

node#

BlockNode

Returns#

void

paneclick()#

readonly paneclick(__namedParameters): void

Defined in: arranger/src/gestures/canvas.ts:142

Parameters#
__namedParameters#
event#

MouseEvent

Returns#

void

pointercancel()#

readonly pointercancel(): void

Defined in: arranger/src/gestures/canvas.ts:256

A cancelled touch is no long press.

Returns#

void

pointerdowncapture()#

readonly pointerdowncapture(event): void

Defined in: arranger/src/gestures/canvas.ts:229

A primary press records itself; a primary touch also starts its long press, which lists the editors under it (longPress) once it has been held LONG_PRESS_MS within the click distance.

Parameters#
event#

PointerEvent

Returns#

void

pointermove()#

readonly pointermove(event): void

Defined in: arranger/src/gestures/canvas.ts:250

A touch moved beyond the click distance is no long press.

Parameters#
event#

PointerEvent

Returns#

void

pointerupcapture()#

readonly pointerupcapture(event): void

Defined in: arranger/src/gestures/canvas.ts:200

Two taps act as a double-click (doubleTap); a tap is a touch released as a click.

Parameters#
event#

PointerEvent

Returns#

void

pressedAt()#

pressedAt(target, client?): Pressed

Defined in: arranger/src/gestures/canvas.ts:81

What target is, read once from its event: its node, its descriptor, the drawing point at client.

Parameters#
target#

EventTarget | null

client?#

Point

Returns#

Pressed

pressedBy()#

pressedBy(event): Selection | null

Defined in: arranger/src/gestures/canvas.ts:103

What a press on the target of event (a key’s: the focused element) selects, as a click would.

Parameters#
event#

KeyboardEvent

Returns#

Selection | null

selectionend()#

readonly selectionend(event): void

Defined in: arranger/src/gestures/canvas.ts:154

The marquee’s result: on the arranger the blocks Svelte Flow marked; in an editor the elements inside the edited element lying wholly in the rectangle from the press to the release. A marquee ending within the click distance is the click it was. Shift+drag replaces the selection; with the marquee toggle on, the result is added to it.

Parameters#
event#

PointerEvent

Returns#

void

Interfaces#

PointerHost#

Defined in: arranger/src/gestures/canvas.ts:26

What the canvas’s pointer reads from the canvas and does through it.

Properties#

nodes#

readonly nodes: CanvasNodes

Defined in: arranger/src/gestures/canvas.ts:29

Methods#

act()#

act(action): void

Defined in: arranger/src/gestures/canvas.ts:42

Close the innermost editor (DONE), centre the view on the edited element again (RECENTRE), or open the editor of an address.

Parameters#
action#

DoubleClick

Returns#

void

editing()#

editing(): Editing | null

Defined in: arranger/src/gestures/canvas.ts:32

Returns#

Editing | null

longPress()#

longPress(pressed, client): void

Defined in: arranger/src/gestures/canvas.ts:44

A touch held on pressed (LONG_PRESS_MS) at the client point client: list the editors under it.

Parameters#
pressed#

Pressed

client#

Point

Returns#

void

marquee()#

marquee(): boolean

Defined in: arranger/src/gestures/canvas.ts:35

Whether the marquee toggle is on: dragging draws a marquee, clicks and marquees add.

Returns#

boolean

metrics()#

metrics(): FontMetrics

Defined in: arranger/src/gestures/canvas.ts:28

Returns#

FontMetrics

rules()#

rules(): LevelRules

Defined in: arranger/src/gestures/canvas.ts:33

Returns#

LevelRules

select()#

select(next): void

Defined in: arranger/src/gestures/canvas.ts:31

Parameters#
next#

Selection

Returns#

void

selection()#

selection(): Selection

Defined in: arranger/src/gestures/canvas.ts:30

Returns#

Selection

toCanvas()#

toCanvas(client): Point | undefined

Defined in: arranger/src/gestures/canvas.ts:37

The canvas point under the client point client; undefined before the flow exists.

Parameters#
client#

Point

Returns#

Point | undefined

view()#

view(): View

Defined in: arranger/src/gestures/canvas.ts:27

Returns#

View

Variables#

LONG_PRESS_MS#

const LONG_PRESS_MS: 500 = 500

Defined in: arranger/src/gestures/canvas.ts:48

A touch held this many milliseconds within the click distance of its press is a long press.