zoomBy

fun zoomBy(factor: Double, anchor: DoubleOffset? = null): Double(source)

Multiplies zoom and optionally preserves one viewport-local anchor.

Values beyond configured limits are clamped. An anchor is applied only after viewport geometry is known; before that publication, zoom changes while the requested center remains unchanged. Bounds clamping may move the anchored content coordinate when preserving it would expose space beyond content.

Return

the resulting clamped zoom multiplier.

Parameters

factor

positive finite zoom multiplier.

anchor

optional finite viewport-local coordinate to keep over the same content coordinate.

Throws

when factor is not finite and positive or the resolved transform cannot remain finite and positive.

when called from another execution owner or synchronously from an observer callback.

when a state observer fails after the new metrics are committed.