https://kotlinlang.org logo
#compose
Title
# compose
m

Moritz Post

01/20/2022, 11:52 AM
Hello. I am using the
Canvas
composable in my compose desktop app. I have found that the
Canvas.onDraw
method is called multiple times although the size of the canvas has not canged. This leads to jank since the drawing is quite intensive. Next to the canvas i have a couple of items that are clickable() so they show hoover feedback for the mouse cursor. Even just hoovering over these unrelated items triggers a redraw of the canvas. Is there a way to circumvent this redrawing?
t

Tgo1014

01/20/2022, 12:11 PM
#compose-desktop
m

Moritz Post

01/20/2022, 12:12 PM
Possible but i am not sure that it is related to the desktop implementaton
t

Tgo1014

01/20/2022, 12:13 PM
but the implementation between platforms are different, so if you have some issue on desktop not necessarily means it happens on android or wear
m

Moritz Post

01/20/2022, 12:14 PM
that is true. i would verify on mobile but haven't gotten around to it yet
3 Views