ZoomableContentTransformation

Graphics transformations generated by Modifier.zoomable when pan & zoom gestures are received.

By default, these are automatically applied by Modifier.zoomable() to its content, but this can be disabled using ZoomableState.autoApplyTransformations if you prefer applying them in a bespoke manner.

Types

Link copied to clipboard
interface ScaleMetadata

Properties

Link copied to clipboard
abstract val centroid: Offset?

Central point around which the last pan/zoom gesture was made with respect to the layout bounds. Will be unspecified if the content hasn't been interacted with yet.

Link copied to clipboard
abstract val contentSize: Size

The size of the zoomable content that is currently known to Modifier.zoomable. This is calculated using the value given to ZoomableState.setContentLocation and may be one frame behind the UI. Useful for synchronizing other elements with the zoomable content.

Link copied to clipboard
abstract val isSpecified: Boolean

Whether this object contains non-placeholder values. This will be false when Modifier.zoomable is initializing and sufficient information to position and show its content is not yet available.

Link copied to clipboard

Inverse of isSpecified.

Link copied to clipboard
abstract val offset: Offset

The translation of the zoomable content along the x and y axes, generated in response to pan gestures. This value represents the amount by which the content should be translated to achieve the desired pan position.

Link copied to clipboard
abstract val rotationZ: Float

The rotation of the zoomable content around the z-axis. This parameter is currently unused and defaults to 0, but may be used in the future if Modifier.zoomable adds support for rotation gestures.

Link copied to clipboard
abstract val scale: ScaleFactor

The scale of the zoomable content along the x and y axes, generated in response to zoom gestures. This value represents the scaling factor that should be applied to the content to achieve the desired zoom level.

Link copied to clipboard

Offset percentage along the x and y axis for which scale and offset must be applied.