what is the best way to make a Rect clickable in canvas?
z
Zach Klippenstein (he/him) [MOD]
04/16/2021, 3:03 PM
Either pull the rectangle into a separate composable and use
Modifier.clickable
on it, or use
Modifier.pointerInput
on your canvas and filter the events to the rect bounds yourself.
s
sonder-joker
04/17/2021, 8:03 AM
Thanks. Now I apply the latter way, but seem the pointer input is fixed which make me can't split the canvas in a single composeable component. Is there any way to get relative place?
z
Zach Klippenstein (he/him) [MOD]
04/17/2021, 4:28 PM
Not sure what you mean by the pointer input being fixed