Package-level declarations
Types
Link copied to clipboard
Link copied to clipboard
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组件状态
Properties
Functions
Link copied to clipboard
suspend fun PointerInputScope.detectTransformGestures(panZoomLock: Boolean = false, gestureStart: () -> Unit = {}, gestureEnd: (Boolean) -> Unit = {}, onTap: (Offset) -> Unit = {}, onDoubleTap: (Offset) -> Unit = {}, onGesture: (centroid: Offset, pan: Offset, zoom: Float, rotation: Float, event: PointerEvent) -> Boolean)
重写事件监听方法
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
标记手势事件结束
Link copied to clipboard
标记手势事件开始
Link copied to clipboard
Link copied to clipboard
fun rememberZoomableState(contentSize: Size? = null, @FloatRange(from = 1.0) maxScale: Float = MAX_SCALE_RATE, animationSpec: AnimationSpec<Float>? = null): ZoomableViewState
返回一个ZoomableState
Link copied to clipboard
让后一个数与前一个数的符号保持一致
Link copied to clipboard
fun ZoomableView(modifier: Modifier = Modifier, boundClip: Boolean = true, state: ZoomableViewState, detectGesture: ZoomableGestureScope = ZoomableGestureScope(), content: @Composable () -> Unit)
支持对Composable就行手势缩放的组件