gestures/flowDrag#

Interfaces#

FlowDragHandlers#

Defined in: arranger/src/gestures/flowDrag.ts:106

What a drag does from the press it was started with.

Methods#

abort()#

abort(): void

Defined in: arranger/src/gestures/flowDrag.ts:114

Ended without a drop: Escape or a cancelled pointer.

Returns#

void

drop()#

drop(at, alt): void

Defined in: arranger/src/gestures/flowDrag.ts:112

Released at at, with Alt held (alt: a copy) or not.

Parameters#
at#

Point

alt#

boolean

Returns#

void

move()#

move(at): void

Defined in: arranger/src/gestures/flowDrag.ts:110

The pointer is at at (client pixels).

Parameters#
at#

Point

Returns#

void

start()#

start(at): void

Defined in: arranger/src/gestures/flowDrag.ts:108

The press has become a drag: past the click distance, once.

Parameters#
at#

Point

Returns#

void


ScreenRect#

Defined in: arranger/src/gestures/flowDrag.ts:25

A rectangle in screen pixels.

Properties#

bottom#

readonly bottom: number

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

left#

readonly left: number

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

top#

readonly top: number

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

Variables#

FADE_DISTANCE#

const FADE_DISTANCE: 96 = 96

Defined in: arranger/src/gestures/flowDrag.ts:16

How far inside the editor’s border, in screen pixels, the twin fades to its faintest.


FLY_DURATION#

const FLY_DURATION: 200 = 200

Defined in: arranger/src/gestures/flowDrag.ts:22

How long, in milliseconds, a twin released inside the editor flies back to where it was lifted.


MIN_TWIN_OPACITY#

const MIN_TWIN_OPACITY: 0.2 = 0.2

Defined in: arranger/src/gestures/flowDrag.ts:19

The twin’s opacity deep inside the editor.

Functions#

dropAt()#

dropAt(point, editor, draft, row): "back" | "canvas" | "draft"

Defined in: arranger/src/gestures/flowDrag.ts:94

Where a drag released at point lands: on the new FlowMap’s row (draft, when one is open) it inserts; inside the editor (editor, the card and the pane) the twin flies back and nothing is stored; beyond the editor’s border a row becomes a card, anything else flies back.

Parameters#

point#

Point

editor#

ScreenRect

draft#

ScreenRect | null

row#

boolean

Returns#

"back" | "canvas" | "draft"


dropIndex()#

dropIndex(spans, x, count): number

Defined in: arranger/src/gestures/flowDrag.ts:74

Where on a row the pointer at abscissa x inserts, spans its drawn entries in order (each index to last drawn once) and count its entries: before the first drawn entry whose middle lies right of x, else at the end.

Parameters#

spans#

readonly object[]

x#

number

count#

number

Returns#

number


followDrag()#

followDrag(event, handlers, slot?): void

Defined in: arranger/src/gestures/flowDrag.ts:124

Follow the press event on its window until its release: the handlers hear the start past the click distance, every move, and the drop or the abort. The drag is held in slot while under way, so Escape ends it.

Parameters#

event#

PointerEvent

handlers#

FlowDragHandlers

slot?#

GestureSlot

Returns#

void


holds()#

holds(rect, point): boolean

Defined in: arranger/src/gestures/flowDrag.ts:84

Whether point lies in rect, its edges included.

Parameters#

rect#

ScreenRect

point#

Point

Returns#

boolean


insideDistance()#

insideDistance(rect, point): number

Defined in: arranger/src/gestures/flowDrag.ts:47

How far point lies inside rect, from its nearest edge: positive inside, 0 on the border, negative outside (the distance to the nearest edge it lies beyond, taken as the largest of the overshoots).

Parameters#

rect#

ScreenRect

point#

Point

Returns#

number


twinOpacity()#

twinOpacity(distance): number

Defined in: arranger/src/gestures/flowDrag.ts:63

The twin’s opacity with the pointer distance screen pixels inside the editor’s border (insideDistance): 1 on and beyond the border, so a row carried out is shown as the card it will become; inside, it fades linearly with the distance to MIN_TWIN_OPACITY at FADE_DISTANCE and stays there deeper in: MIN + (1 − MIN) × max(0, 1 − d / FADE).

Parameters#

distance#

number

Returns#

number


unionRect()#

unionRect(left, right): ScreenRect

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

The smallest rectangle holding both.

Parameters#

left#

ScreenRect

right#

ScreenRect

Returns#

ScreenRect