gestures/resize#

Interfaces#

ResizeHost#

Defined in: arranger/src/gestures/resize.ts:15

The resize toolbar’s side of a resize.

Properties#

actions#

readonly actions: NodeActions

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

Methods#

autoPan()#

autoPan(screen): Promise<boolean>

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

Pan the canvas at Svelte Flow’s auto-pan speed when the client point screen lies in the pane’s edge band; whether it panned.

Parameters#
screen#

Point

Returns#

Promise<boolean>

level()#

level(): Level

Defined in: arranger/src/gestures/resize.ts:20

The level the resize is made at.

Returns#

Level

locked()#

locked(): boolean

Defined in: arranger/src/gestures/resize.ts:24

Whether the toolbar takes no resize: the canvas is locked or read-only.

Returns#

boolean

mode()#

mode(): ResizeMode | undefined

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

The mode the toolbar shows; undefined where it offers none.

Returns#

ResizeMode | undefined

target()#

target(): object

Defined in: arranger/src/gestures/resize.ts:18

The block resized, as stored, and the box of its drawing resized: its own box, a frame or a card.

Returns#

object

block#

readonly block: Block

box#

readonly box: DrawnBox

viewport()#

viewport(): Viewport

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

Returns#

Viewport


ResizePress#

Defined in: arranger/src/gestures/resize.ts:34

What a press on a handle holds.

Properties#

block#

readonly block: Block

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

box#

readonly box: DrawnBox

Defined in: arranger/src/gestures/resize.ts:38

frame#

frame: number | null

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

The animation frame of the auto-pan, while the resize is under way.

last#

last: Point

Defined in: arranger/src/gestures/resize.ts:45

The pointer’s last client point, which the auto-pan reads again after each pan.

level#

readonly level: Level

Defined in: arranger/src/gestures/resize.ts:39

mode#

readonly mode: ResizeMode

Defined in: arranger/src/gestures/resize.ts:40

pan#

readonly pan: Point

Defined in: arranger/src/gestures/resize.ts:43

screen#

readonly screen: Point

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

The pointer’s client point at the press, and the viewport’s pan then.

view#

readonly view: View

Defined in: arranger/src/gestures/resize.ts:36

The view as stored at the press, which the command is built on.

Functions#

resizeGesture()#

resizeGesture(host, handle): GestureStrategy<ResizePress, Delta>

Defined in: arranger/src/gestures/resize.ts:60

The resize by handle: the pointer’s travel in canvas units (its screen travel less the viewport’s pan since the press, over the zoom) is the resize’s delta. A block becomes new placement values (resize), a frame or a card new places (itemResizeValues); the release stores them in one set, nothing when every value is stored already. While the pointer lies in the pane’s edge band the canvas pans every frame, and the preview follows the canvas point under the pointer, as Svelte Flow does for a node drag.

Parameters#

host#

ResizeHost

handle#

Handle

Returns#

GestureStrategy<ResizePress, Delta>