I'm using transformable modifier on my composable ...
# compose
z
I'm using transformable modifier on my composable and I was wondering how I could set some limits for the zoom. I also want to have it prevent the user from moving the offset further than the content. How any other application does image zooming/panning is what I'm going for here.
Copy code
val transformableState = rememberTransformableState { zoomChange, offsetChange, _ ->
    scale *= zoomChange
    offset += offsetChange
}
l
To set a limit for the zoom, just modify your scale variable. We have scale = (scale * zoomChange).coerceAtMost(3.0) in one project.
You can do the same for offset. It will take the value you give it.