ZoomImageParams Class

@Immutable data class ZoomImageParams(val minScale: Float, val tapScale: Float, val maxScale: Float, val scrollPadding: PaddingValues)

How a zoomable image behaves: the zoom limits and how it responds to gestures.

All three scales are absolute values, not steps relative to the current zoom: a double tap sets the scale to tapScale rather than multiplying by it. Pinch-to-zoom is the exception, and is bounded by the same limits.

Those limits always admit the scale that fits the image to the view, whether or not it lies between minScale and maxScale. A page whose fitted scale is larger than maxScale therefore widens the range rather than being clipped by it, and a tapScale below the fitted scale is clamped up to it.

Parameters

  • minScale — the smallest scale the user can zoom out to, or Float.NaN to stop at the scale that fits the image to the view.
  • tapScale — the scale a double tap zooms to.
  • maxScale — the largest scale the user can zoom in to, or Float.NaN for the fitted scale.
  • scrollPadding — space kept between the image and the edges of the view, so a zoomed image can be panned clear of surrounding controls.

Constructors

ZoomImageParams

constructor(minScale: Float, tapScale: Float, maxScale: Float, scrollPadding: PaddingValues)

Properties

maxScale

val maxScale: Float

minScale

val minScale: Float

scrollPadding

val scrollPadding: PaddingValues

tapScale

val tapScale: Float
Top