windease API reference - v0.6.0
    Preparing search index...

    Function insertionIndexByMidpoint

    • Compute a 0-based insertion index based on which child midpoint the cursor has passed along the main axis. The returned value is in [0, rects.length].

      Use with axis: 'y' for vertical stacks; axis: 'x' for horizontal strips.

      Parameters

      • rects: readonly (RectYBounds | RectXBounds)[]
      • cursorMain: number
      • axis: "x" | "y"

      Returns number