Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't change zoom after creation (SVG) #81

Open
jacasch opened this issue Jul 30, 2019 · 2 comments
Open

can't change zoom after creation (SVG) #81

jacasch opened this issue Jul 30, 2019 · 2 comments

Comments

@jacasch
Copy link

jacasch commented Jul 30, 2019

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
Copy link
Author

jacasch commented Jul 30, 2019

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 jacasch changed the title can't change zoom after creation can't change zoom after creation (SVG) Jul 31, 2019
@cwittenb
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants