coordinate System
Modifier.zoomable()'s coordinate system for representing spatial offsets in CoordinateSpace.Viewport and CoordinateSpace.ZoomableContent.
Usage example:
val state = rememberZoomableState()
val viewportCenter = SpatialOffset(
offset = Offset(100f, 100f),
space = CoordinateSpace.Viewport,
)
// If a 200 x 200 viewport is showing a zoomed-out 500 x 500 image,
// this will return (250f, 250f) in the image's coordinate space.
val imageCenter: Offset = with(state.coordinateSystem) {
viewportCenter.offsetIn(CoordinateSpace.ZoomableContent)
}Content copied to clipboard