ZoomableViewState

open class ZoomableViewState(@FloatRange(from = 1.0) val maxScale: Float = MAX_SCALE_RATE, offsetX: Float = DEFAULT_OFFSET_X, offsetY: Float = DEFAULT_OFFSET_Y, scale: Float = DEFAULT_SCALE, rotation: Float = DEFAULT_ROTATION, animationSpec: AnimationSpec<Float>? = null) : CoroutineScope

viewer状态对象,用于记录compose组件状态

Parameters

offsetX

X轴偏移量

offsetY

Y轴偏移量

scale

缩放率

rotation

旋转角度

animationSpec

动画窗格

Constructors

Link copied to clipboard
constructor(@FloatRange(from = 1.0) maxScale: Float = MAX_SCALE_RATE, offsetX: Float = DEFAULT_OFFSET_X, offsetY: Float = DEFAULT_OFFSET_Y, scale: Float = DEFAULT_SCALE, rotation: Float = DEFAULT_ROTATION, animationSpec: AnimationSpec<Float>? = null)

Types

Link copied to clipboard
object Companion

Properties

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

最大缩放率

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

Functions

Link copied to clipboard
suspend fun fixToBound()

修正offsetX,offsetY的位置

Link copied to clipboard

判断是否有动画正在运行

Link copied to clipboard
fun ZoomableViewState.onGesture(scope: CoroutineScope, center: Offset, pan: Offset, zoom: Float, rotate: Float, event: PointerEvent): Boolean

输入手势事件

Link copied to clipboard
fun ZoomableViewState.onGestureEnd(scope: CoroutineScope, transformOnly: Boolean)

标记手势事件结束

Link copied to clipboard
fun ZoomableViewState.onGestureStart(scope: CoroutineScope)

标记手势事件开始

Link copied to clipboard
suspend fun reset(animationSpec: AnimationSpec<Float> = defaultAnimateSpec)

设置回初始值

Link copied to clipboard
suspend fun resetImmediately()

立即设置回初始值

Link copied to clipboard
suspend fun toggleScale(offset: Offset, animationSpec: AnimationSpec<Float> = defaultAnimateSpec)

放大或缩小