detectTapWithOrigin

Extension function for Modifier that detects tap gestures and calculates the tap's origin as a TransformOrigin, which represents the position as a fraction of the size of the element.

Return

The Modifier with added tap detection behavior.

Parameters

onTap

A lambda function that receives a TransformOrigin representing the fraction of the tap position relative to the width and height of the element.