https://kotlinlang.org logo
Title
k

Kebbin

02/15/2022, 12:49 PM
Hello @Igor Demin! How are you? Just wondering if you guys have had any success sorting the Object Touch Targets issue with the 3D transformation? Thanks! Cheers.
i

Igor Demin

02/15/2022, 1:38 PM
Hi! We haven't looked at it yet. Not sure, but you probably can fix the issue on your side, by applying the same transformation matrix to the event position.
k

Kebbin

02/15/2022, 11:03 PM
Ok! Yes, I had wondered about that idea. Any idea how I would start creating that fix? Also, would the cursor movement be limited to the transformed screen size/area, or be able to continue moving into the distance? You can see so much more of the image once it's tilted back, compared to what you would see in the screen limits. Thanks, and I'll keep thinking about it.
i

Igor Demin

02/16/2022, 1:40 PM
Also, would the cursor movement be limited to the transformed screen size/area, or be able to continue moving into the distance
Honestly, I don't know until diving into the issue. It depends on the
graphicsLayer
contract (also worth to look how it works on Android) To fix issue on your side, you can extend available space, subscribe to
Modifier.pointerInput
, multiply position to the transformation matrix, and do your own hit testing. This can't be fixed though, if you render default Compose components (Button, Slider, etc) instead of your own in the transformed Box. But using
graphicsLayer
probably isn't the best idea too, until this issue is fixed.
k

Kebbin

02/16/2022, 9:17 PM
Thank you mate! I'll have a look into what you've suggested. Cheers.