if I were interpreting 1,000s of x, y coordinates ...
# compose-desktop
c
if I were interpreting 1,000s of x, y coordinates a second from a graphics tablet like device and trying to render the result in real time in compose, would I be completely insane wrong to use a mutableStateListOf Path objects? It feels like I want to go down a level, but I'm not sure how I'd do that. (I guess this isn't strictly K either 🤡 )
r
Why use a list of Paths? You could just add more points/lines to a single Path
c
🤦‍♂️
the easy option you mean! As it happens, the list of paths seems to work nice! (And I guess that'd give me easy undo too perhaps), but yeah I'll go for single path. I didn't realise that updating the path would result in a recomposition. Cheers Romain
message has been deleted
r
The main "issue" with a list of Paths is the number of draw calls you'll make
c
would it be possible to compose build a single mega path out of a list of paths, so if I did do an undo operation, I could just rebuild the mega path?
r
You can yes
c
sweet so I can just maintain a list of source paths, then do operations on them and rebuild the actual drawing path, that's super useful
r
But you could also keep a list of Paths for every time the pen goes up
And only update the "current" path
c
cheers I'll have a play! I'm still used to having to work hard for everything that getting so much for free is unexpected haha
r
😁