edgeHugLayout

fun edgeHugLayout(zone: RadialMenuMath.MenuZone, screenWidth: Float, screenHeight: Float, itemCount: Int, itemSizePx: Float, gapPx: Float, padPx: Float): List<Offset>(source)

Computes item center positions for the edge-hug L-shaped layout.

Items are split across the two available edges adjacent to the corner. The primary edge gets ceil(itemCount / 2) items, the secondary gets the remainder. The corner cell itself (the intersection of the two edges) is always vacant — items start one full step away from the corner.

Return

List of Offset item center positions, primary edge first.

Since

1.0.3

Parameters

zone

Which corner the touch is in. Must be a CORNER_* value.

screenWidth

Screen width in pixels.

screenHeight

Screen height in pixels.

itemCount

Number of items to position.

itemSizePx

Item diameter in pixels.

gapPx

Gap between items in pixels.

padPx

Padding from screen edge in pixels.