snapBackZoomable

fun Modifier.snapBackZoomable(zoomState: ZoomState, zoomEnabled: Boolean = true, onTap: (position: Offset) -> Unit = {}, onDoubleTap: suspend (position: Offset) -> Unit = {}): Modifier

A modifier function that allows content to be zoomable and automatically return to its original size when the finger is released.

Parameters

zoomState

A ZoomState object.

zoomEnabled

specifies if zoom behaviour is enabled or disabled. Even if this is false, onTap and onDoubleTap will be called.

onTap

will be called when single tap is detected on the element.

onDoubleTap

will be called when double tap is detected on the element. This is a suspend function and called in a coroutine scope. The default is to toggle the scale between 1.0f and 2.5f with animation.