• Where a panel of size goes beside anchor without leaving bounds: to the right of it by gap, its top on the anchor's top, then pulled up (never past pad) when it would run off the bottom, and flipped to the left only when the right has no room at all. Coordinates are in whatever space the anchor and the bounds share.

    Parameters

    • anchor: Box
    • size: Size
    • bounds: Size
    • gap: number = 6
    • pad: number = 8

    Returns { left: number; side: "left" | "right"; top: number }