https://kotlinlang.org logo
r

romainguy

07/18/2020, 7:01 AM
Using
Canvas.scale()
j

Jorge Castillo

07/18/2020, 11:11 AM
My canvas is taking the whole screen, actually. But the vector original size is quite smaller so the path renders as the original size on the top left corner. What I'd want to aim for is to make the path adapt to the canvas size, so it takes as much space as possible within the canvas. If I scaled the canvas to be bigger that might scale up the vector, but would break the screen layout composition.
I'm animating a path on the canvas (i.e rendering a bigger amount of path nodes per tick to achieve a silhouette animation) so I wanted to stay on the canvas level, like, not wrapping into Image or similar .
r

romainguy

07/18/2020, 2:34 PM
Scale the canvas while you draw the path and remove the scale
j

Jorge Castillo

07/18/2020, 4:05 PM
Got it 👍 I'll try!
Worked great 🥳
thanks!
5 Views