focus#

Variables#

FOCUS_DURATION#

const FOCUS_DURATION: 1000 = 1000

Defined in: arranger/src/focus.ts:14

How long, in milliseconds, the view takes to move to an editor and back.


FOCUS_MARGIN#

const FOCUS_MARGIN: 0.1 = 0.1

Defined in: arranger/src/focus.ts:16

The share of the canvas area left free on each side of the focused element.


FOCUS_MAX_ZOOM#

const FOCUS_MAX_ZOOM: 4 = 4

Defined in: arranger/src/focus.ts:20

The largest zoom the focus moves to.


FOCUS_MIN_ZOOM#

const FOCUS_MIN_ZOOM: 0.05 = 0.05

Defined in: arranger/src/focus.ts:18

The smallest zoom the focus moves to.

Functions#

elidedReach()#

elidedReach(node, target): number | null

Defined in: arranger/src/focus.ts:84

How far the elided ancestor cards behind the frame of the group target reach out from the frame’s horizontal centre c, in canvas units: the largest of c less a card’s left edge and its right edge less c, over the displayed ancestor cards lying behind that frame (ancestor.groups: a root drawn once behind a row lies behind each of its groups) that elide: that draw a gap, or that Proportional fits at r = 1 (drawing none, since the whole card fits). null for a target that is no group, for a group whose frame is not drawn, and where no such card is drawn: every card drawn whole.

Parameters#

node#

BlockNode

target#

Address

Returns#

number | null


focusViewport()#

focusViewport(bounds, pane, drawerWidth, reach?): Viewport

Defined in: arranger/src/focus.ts:127

The viewport that centres bounds (canvas units) in the pane (pane, screen pixels) less the drawer of width drawerWidth on its right, with FOCUS_MARGIN of that area free on each side: the zoom at which the bounds fill the remaining area along the tighter axis, clamped to [FOCUS_MIN_ZOOM, FOCUS_MAX_ZOOM]. With reach, the canvas units that must be seen on each side of the bounds’ horizontal centre (an elided ancestor card’s, elidedReach), the zoom is at most the one at which that reach fills half the area left free of the margins: min(zoom, f · W / (2 · reach)), f the area less both margins and W the width left of the drawer, still at least FOCUS_MIN_ZOOM.

Parameters#

bounds#

Rect

pane#
height#

number

width#

number

drawerWidth#

number

reach?#

number | null = null

Returns#

Viewport


targetBounds()#

targetBounds(node, target, metrics): Rect

Defined in: arranger/src/focus.ts:35

The canvas rectangle of the editor target target in node’s block: the block’s box for the block itself, the displayed frame of a group or card of a timeline (its first, for a member of several groups), and for a timeline drawn in no displayed card of its own (a child, or a hidden card) the rectangle spanning every element drawn inside it (core’s contains, layout’s boundsOf), leaving out the copies an ancestor card draws below the frames while it is not raised (stackingOf).

Parameters#

node#

BlockNode

target#

Address

metrics#

FontMetrics

Returns#

Rect