I am currently working with a canvas that holds shapes. So I want to be able to keep the shapes size while zooming in or out. I think that I need to know the canvas scale or the dpi, so I can recalculate the shape dimensions. My questions
- Is there better solution for that?
- If I am on the good track how can I get the current scale of a canvas? I am looking for something like in the code below.
let scale = ctx.getCurrentScale();
.
Thanks for your help.