File tree Expand file tree Collapse file tree
cropper/src/main/java/com/smarttoolfactory/cropper Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import androidx.compose.runtime.*
55import androidx.compose.ui.Modifier
66import androidx.compose.ui.composed
77import androidx.compose.ui.draw.clipToBounds
8+ import androidx.compose.ui.geometry.Offset
89import androidx.compose.ui.geometry.Rect
910import androidx.compose.ui.graphics.graphicsLayer
1011import androidx.compose.ui.input.pointer.pointerInput
@@ -92,11 +93,14 @@ fun Modifier.crop(
9293
9394 val tapModifier = Modifier .pointerInput(* keys) {
9495 detectTapGestures(
95- onDoubleTap = {
96+ onDoubleTap = { offset : Offset ->
9697 coroutineScope.launch {
9798 zoomLevel = getNextZoomLevel(zoomLevel)
9899 val newZoom = zoomOnDoubleTap(zoomLevel)
99- cropState.onDoubleTap(zoom = newZoom) {
100+ cropState.onDoubleTap(
101+ offset = offset,
102+ zoom = newZoom
103+ ) {
100104 onGestureEnd?.invoke(cropState.cropData)
101105 }
102106 }
You can’t perform that action at this time.
0 commit comments