ZoomableCoordinateSystem

Modifier.zoomable()'s coordinate system for representing spatial offsets in CoordinateSpace.Viewport and CoordinateSpace.ZoomableContent.

Usage example:

val visibleImageRegion = with(zoomableState.coordinateSystem) {
contentBounds.rectIn(CoordinateSpace.ZoomableContent)
}

Properties

Link copied to clipboard

The visible bounds of the content after user zoom and pan. This is calculated by applying contentScale and contentAlignment to the value passed to ZoomableState.setContentLocation.

Link copied to clipboard

Like contentBounds, but without any user transformations. This is the initial bounds of the content, where the content is displayed prior to any zoom or pan gestures. This property is intended for drawing decorations around the content that remain unaffected by zoom and pan gestures.

Link copied to clipboard
abstract val viewportSize: Size

Size of the composable where Modifier.zoomable() is used.

Functions

Link copied to clipboard
abstract fun contentBounds(clipToViewport: Boolean): SpatialRect

Same as contentBounds.

Link copied to clipboard

Converts this SpatialOffset to a raw Offset in the target coordinate space.

Link copied to clipboard
Link copied to clipboard
abstract fun SpatialRect.rectIn(target: CoordinateSpace): Rect

Convert this SpatialRect to a raw Rect in the target coordinate space.

Link copied to clipboard

Resolve this SpatialRect's size in the target coordinate space.

Link copied to clipboard
abstract fun unscaledContentBounds(clipToViewport: Boolean): SpatialRect