Hi :wave: :smile: Does anyone know if it is possi...
# compose
o
Hi 👋 😄 Does anyone know if it is possible to do a linear transformation on the canvas in jetpack compose? So what I mean is mapping each point (u, v) on for instance an arch to (x, y) based on a function f so that f(u, v) = (x, y). Is that possible? 🙂 Is there any good docs on how to do that if it is possible? 🙂
a
You might find this helpful. It’s a timer where the tick marks form a circle. Implemented following Leland’s

streamâ–¾

about a similar timer.
r
If its just a simple X, Y size mapping, you can do something like this https://stackoverflow.com/questions/53861320/calculate-new-point-coordinates-after-imageview-translation . If you need to take into account multiple transformations, ie rotation too, you might want to look into using a Matrix, applying the transformations to it, then use Matrix#map on it to transform the coordinate with all the already applied transformations.
o
Wow! That is nice! Thanks for the answers! I think maybe the matrix approach will work in my case 🙂