Hi everyone, I have this issue where I want the parent to be transformable (zoom) and children to be...
a
Hi everyone, I have this issue where I want the parent to be transformable (zoom) and children to be clickable, but for some reason zooming sometimes doesn’t work. It happens when I put 2 fingers on different children and try to pinch. Anybody knows what the problem is? code is in the thread
Copy code
var scale by remember { mutableStateOf(1f) }

Row(
    modifier = Modifier
        .fillMaxSize()
        .pointerInput(Unit) {
            detectTransformGestures { centroid, pan, zoom, rotation ->
                scale = (scale * zoom).coerceIn(1f, 2.5f)
            }
        }
) {
    repeat(3) {
        Column(
            modifier = Modifier
                .weight(1f)
                .fillMaxHeight()
        ) {
            repeat(3) {
                Box(
                    modifier = Modifier
                        .weight(1f)
                        .fillMaxWidth()
                        .clickable { }
                )
            }
        }
    }
}
d
I actually ran into the same issue. I am not sure how to fix it yet.
I wrapped my object in a
Box
composable and it handles the gesture detection.