metafizzy / zdog

Flat, round, designer-friendly pseudo-3D engine for canvas & SVG
https://zzz.dog
10.38k stars 394 forks source link

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

Closed dgholz closed 5 years ago

dgholz commented 5 years ago

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?

desandro commented 5 years ago

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 commented 5 years ago

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

dgholz commented 5 years ago

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