commonMain.me.saket.telephoto.zoomable.ZoomSpec.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zoomable-desktop Show documentation
Show all versions of zoomable-desktop Show documentation
A Modifier for making anything zoomable.
The newest version!
package me.saket.telephoto.zoomable
import androidx.compose.runtime.Immutable
import dev.drewhamilton.poko.Poko
@Poko
@Immutable
class ZoomSpec(
/**
* The maximum zoom level as a percentage of the content size before rubber banding kicks in.
*
* For example, a value of `3.0` indicates that the content can be zoomed in up to 300%
* of its original size. Setting this value to `1.0` or less will disable zooming.
*/
val maxZoomFactor: Float = 2f,
/**
* Whether to apply rubber banding to zoom gestures when content is over or under zoomed
* as a form of visual feedback that the content can't be zoomed any further. When set to false,
* content will keep zooming in a free-form manner even when it goes beyond its boundaries
* (until the gesture is released).
*/
val preventOverOrUnderZoom: Boolean = true,
) {
internal val range = ZoomRange(maxZoomAsRatioOfSize = maxZoomFactor)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy