Skip to content
D
Documentation

Canvas — constants

reference
1 min readUpdated

Constants

Import these from @grafloria/renderer.

Constants

ALWAYS_SAFE_MODE

Modes it is always safe to be in.

ts
const ALWAYS_SAFE_MODE: BackendMode

CANVAS_LINK_HIT_TOLERANCE

Link pick tolerance, in WORLD units.

Not a new number — it IS the floor InteractionController applies in SVG mode, imported from the one place that owns it. Hit parity between the two backends is therefore a property of the code, not a coincidence maintained by two constants that happen to agree today. (The full grab distance is per link — linkBodyHitTolerance(strokeWidth) — which both backends now use.)

ts
const CANVAS_LINK_HIT_TOLERANCE: 5

IDENTITY

ts
const IDENTITY: Matrix

INHERITED_DEFAULTS

Style values that INHERIT from a parent element in SVG.

ts
const INHERITED_DEFAULTS: ComputedStyle

NULL_CONTEXT

A Canvas2DLike that does nothing — the measure pass draws into it.

ts
const NULL_CONTEXT: Canvas2DLike

Was this page helpful?

Canvas — constants — Grafloria