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

adding more shapes & calling scene.updateGraph() should always let the new shapes appear when rendered #21

Closed
dgholz opened this issue May 30, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@dgholz
Copy link

dgholz commented May 30, 2019

I'm filing this on behalf of The_Amp_Walrus (https://news.ycombinator.com/item?id=20047206), who has an example CodePen of https://codepen.io/anon/pen/QRZKxy

Since calling scene.updateGraph() caches the flatGraph on its first call (as part of checkFlatGraph, (https://github.com/metafizzy/zdog/blob/v1.0.1/js/anchor.js#L124)), subsequent calls to updateGraph don't update the flatGraph to match the children of the scene.

Could the flatmap always be updated whenever updateGraph is called?

@dgholz dgholz changed the title adding more shapes & calling scene.updateGraph() should always let the new shapes appear when rendered adding more shapes & calling scene.updateGraph() should always let the new shapes appear when rendered May 30, 2019
@desandro desandro added the bug Something isn't working label May 30, 2019
@desandro
Copy link
Member

Thanks for reporting this issue. This is indeed a bug. I'll have a fix up in the next couple days. The fix will be part of the 1.0.2 release

desandro added a commit that referenced this issue Jun 4, 2019
+ add updateFlatGraph to updateGraph
+ add custom getter/setter for flatGraph, to remove checkFlatGraph
+ refactor flatGraph array
+ add addChildFlatGraph
@desandro
Copy link
Member

desandro commented Jun 4, 2019

v1.0.2 has been released with a fix for these bug. Please update! Closing as fixed.

@desandro desandro closed this as completed Jun 4, 2019
@dgholz
Copy link
Author

dgholz commented Jun 4, 2019

checked the behaviour in the codepen, I see adding shapes & calling updateGraph multiple times updates the rendered image. lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants