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

    Function composeAffordanceLayer

    • Experimental

      Bundle a list of Affordances into a single RenderLayer.

      Each affordance declares interactive regions in target-local coordinates; this layer composes each target's bounds transform (rotation around the AABB center, when present) once per region for both paint and hit-test.

      FillStyle order matches array order (first → last = bottom → top). Hit-test walks regions in reverse (top → bottom) and returns the first non-null binding.

      decorate(state, view) runs after a given affordance's regions for paint only — useful for leader lines and other purely-visual chrome that don't fit the region model.

      Parameters

      • id: string
      • label: string
      • affordances: readonly Affordance[]

      Returns RenderLayer<ChromeState> & {
          hitTest(
              wx: number,
              wy: number,
              state: ChromeState,
              view: View,
              dims: { height: number; width: number },
              isVisible?: (id: string) => boolean,
          ): AffordanceBinding<unknown> | null;
      }