dikalo/lienzo-core

Question: keep shape size constant during zooming

mani76 opened this issue · 1 comments

Hello,

What would be the best option to implement shape whose location is anchored to the other shape but which does not change zooming when layer is transformed.

I have arrow shape which have also text shape and both are attached to the transformable layer. How do I keep the text size constant even if layer is zoomed. Text location must still change according to the arrow location but only the zooming must be constant.

This is doable but tricky, I can create a flag that says "don't transform" from some level, but obviously, part of the transformation of the viewport modifies not just the shapes size, but it's x/y position on the screen. So we have to extract the x,y position out of the zoom transformation, cancel the rest, and patch up the x,y coordinates. I have it in 2.1 and will definitely look into it.