CameraState

class CameraState(panX: Double = 0.0, panY: Double = 0.0, zoom: Double = 1.0)

Mutable camera state for programmatic viewport control.

All properties are backed by Compose snapshot state — mutations trigger recomposition of any composable that reads them.

Parameters

panX

Initial horizontal pan offset in pixels (default: 0.0, must be finite)

panY

Initial vertical pan offset in pixels (default: 0.0, must be finite)

zoom

Initial zoom factor (default: 1.0, must be positive and finite)

Constructors

Link copied to clipboard
constructor(panX: Double = 0.0, panY: Double = 0.0, zoom: Double = 1.0)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun pan(deltaX: Double, deltaY: Double)

Pan the camera by a delta.

Link copied to clipboard
fun reset()

Reset to default state.

Link copied to clipboard
fun zoomBy(factor: Double)

Zoom the camera by a factor around the current center.