zdog icon indicating copy to clipboard operation
zdog copied to clipboard

can't change zoom after creation (SVG)

Open jacasch opened this issue 5 years ago • 2 comments

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

jacasch avatar Jul 30 '19 18:07 jacasch

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

jacasch avatar Jul 30 '19 19:07 jacasch

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.

cwittenb avatar Feb 28 '22 21:02 cwittenb