get Selection From Drag
fun getSelectionFromDrag(dragX: Float, dragY: Float, centerAngle: Float, itemCount: Int, spreadDegrees: Float = RadialMenuDefaults.ICON_SPREAD_DEGREES, deadZonePx: Float = RadialMenuDefaults.DEAD_ZONE_PX, selectionDeadZoneDeg: Float = RadialMenuDefaults.SELECTION_DEAD_ZONE_DEG): Int?(source)
Determines which item index the user is dragging toward.
The algorithm computes the angle of the drag vector and finds the closest menu item. If the angular distance exceeds selectionDeadZoneDeg, no item is selected.
Return
Index of the selected item, or null if in dead zone or no match.
Parameters
drag X
Horizontal drag delta from touch origin in pixels.
drag Y
Vertical drag delta from touch origin in pixels.
center Angle
The menu's center angle from calculateCenterAngle.
item Count
Number of items in the menu.
spread Degrees
Angular spacing between items.
dead Zone Px
Minimum drag distance to register.
selection Dead Zone Deg
Maximum angle from nearest item to count as selected.