zdog
zdog copied to clipboard
can't change zoom after creation (SVG)
When changing the zoom of an illustration (illo.zoom) and then updating the render graph, the zoom value is ignored. It just stays at the initial value. Weirdly this doesnt happen on codepen, just on local websites where zdog is used. I dont understand why.
here it works https://codepen.io/jacasch/pen/oKWjvx here it doesn't https://github.com/jacasch/zdog-zoom-test
I could find out why the codepen one works, but not the other one.
it works when you use a <canvas/>
but not with <svg/>
demo https://codepen.io/jacasch/pen/KOmVPw
Just in case somebody has still has this problem, this is how I dealt with it:
On redraw explicitly call illustation.setSizeSvg(illustration.width, illustration.height)
after updateRenderGraph(), this resets the viewport taking zoom into account.