weasel API - v0.8.0
    Preparing search index...

    Interface ChromeState

    Read-only state that affordances consult on every render and hit-test call. Built once per Canvas render via buildChromeState; affordances must not cache it across calls.

    interface ChromeState {
        modifiers: ModifierState;
        multiActive: boolean;
        selection: readonly NodeId[];
        unionBounds: Bounds | null;
        boundsOf(id: string): Bounds | null;
        canRotate?(id: string): boolean;
    }
    Index

    Properties

    modifiers: ModifierState

    Active modifier state at the moment of the call.

    multiActive: boolean

    True when the canvas is in multi-mode AND >= 2 ids are selected.

    selection: readonly NodeId[]

    Currently selected ids. Live; reflects useSelection's React state.

    unionBounds: Bounds | null

    Multi-union AABB when multiActive. Computed lazily from boundsOf over every selected id; null otherwise.

    Methods

    • Bounds for any selection member id. Honors active-tool overlay state (move/resize/rotate ghosts → ghost bounds; otherwise → committed pose bounds). Returns null for unknown ids or ids whose bounds aren't computable.

      Parameters

      • id: string

      Returns Bounds | null

    • True iff the node's pose-descriptor declares it can carry a rotation. Affordances consult this to decide whether to expose rotate cursors / drag-bands. Defaults to true when the descriptor doesn't declare (back-compat) or when the id is unknown — the rotation gesture will no-op visually for poses without AABB fields, but the affordance doesn't lie about the cursor. Optional on the interface so unit-test call sites that construct ChromeState by hand keep compiling; affordances should treat an absent predicate as "true".

      Parameters

      • id: string

      Returns boolean