PanZoomMetrics

data class PanZoomMetrics(val center: DoubleOffset = DoubleOffset.Zero, val zoom: Double = 1.0, val scale: Double = 1.0, val viewportSize: IntSize = IntSize.Zero, val contentBounds: LongRect = LongRect.Zero, val fit: PanZoomFit = PanZoomFit.Contain, val geometryKnown: Boolean = false)(source)

Immutable position and resolved geometry snapshot for a pan-and-zoom viewport.

PanZoomMetrics.zoom is a multiplier over the base PanZoomMetrics.fit scale, while PanZoomMetrics.scale is the resolved number of logical viewport pixels per content unit. Before a viewport publishes geometry, PanZoomMetrics.geometryKnown is false and PanZoomMetrics.scale is only a finite placeholder that must not be used for coordinate conversion.

Throws

when numeric values are not finite and positive where required, or known geometry is empty.

Constructors

Link copied to clipboard
constructor(center: DoubleOffset = DoubleOffset.Zero, zoom: Double = 1.0, scale: Double = 1.0, viewportSize: IntSize = IntSize.Zero, contentBounds: LongRect = LongRect.Zero, fit: PanZoomFit = PanZoomFit.Contain, geometryKnown: Boolean = false)

Properties

Link copied to clipboard

content coordinate shown at the viewport center.

Link copied to clipboard

current positive half-open content bounds when PanZoomMetrics.geometryKnown is true.

Link copied to clipboard

base scale policy.

Link copied to clipboard

whether a viewport has published usable geometry.

Link copied to clipboard

resolved logical viewport pixels per content unit.

Link copied to clipboard

current positive viewport extent when PanZoomMetrics.geometryKnown is true.

Link copied to clipboard

caller-controlled multiplier over the base fit scale.