get Nearest Item Selection
fun getNearestItemSelection(pointerX: Float, pointerY: Float, itemPositions: List<Offset>, deadZonePx: Float = RadialMenuDefaults.DEAD_ZONE_PX): Int?(source)
Selects the nearest item by Euclidean distance from the pointer.
This replaces angle-based selection when the menu is in edge-hug mode, since items are no longer arranged radially.
Return
Index of the nearest item, or null if within dead zone of the touch origin.
Since
1.0.3
Parameters
pointer X
Pointer X position in pixels (absolute screen coords).
pointer Y
Pointer Y position in pixels (absolute screen coords).
item Positions
List of item center positions from edgeHugLayout.
dead Zone Px
Minimum distance from any item to register a selection.