what is the best way to make a Rect clickable in c...
# compose-desktop
s
what is the best way to make a Rect clickable in canvas?
z
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
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
Not sure what you mean by the pointer input being fixed