Is there a compose multiplatform channel? Where I ...
# compose-desktop
l
Is there a compose multiplatform channel? Where I can ask that type of questions? The question is how to handle mouse/finger moves for canvas? I'm rendering a map with canvas and want to handle drag, zoom etc actions. In the kotlin common code. I found detectTransformGestures but seems it's not working for desktop scroll I found other map libraries, but there is not enough features. And they have complex pointer handling. I feel there should be one builtin way for it (like detectTransformGestures).
5
d
+1 Want for a Compose Multiplatform channel. Might be redundant with the Desktop and Web channels, but we seem to lack a space to rally for Multiplatform as the ecosystem, and work through its unique configuration issues.
s
I feel like I just use the desktop or the compose channels for that currently.
m
@lewik Concerning your map question. I use detectTapGestures, detectTransformGestures and awaitPointerEventScope and that works on desktop as well as on Android. I can, e.g., zoom in/out with the two finger gesture on Android or via mouse-wheel on desktop. What exactly are your requirements?
g
I've been using this for zoom and pan
Copy code
suspend fun PointerInputScope.detectTransformGestures(
    panZoomLock: Boolean = false,
    onGesture: (centroid: Offset, pan: Offset, zoom: Float, rotation: Float) -> Unit
)
but it does not seem to work on Desktop or web-canvas with the scroll wheel. I had a look at the documentation for awaitPointerEventScope - it looks like if you use PointerEvent.calculateZoom() then you may not need to use detectTransformGestures at all? Does that behave as expected for desktop?