metafizzy / zdog

Flat, round, designer-friendly pseudo-3D engine for canvas & SVG

Home Page:https://zzz.dog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Updating Box properties does not update faces

alexgoff opened this issue · comments

After creating a Shape object such as a Box, setting properties like color do not set the property for children such as rectangles that make up the faces.

Example:

let box = new Zdog.Box({
     addTo: scene,
     color: '#fa0',
     ...
});

box.color = '#ef9';

This will set the parent item's color to '#ef9' but not the children which have their own color properties. Children can currently be set by iterating through the parent item and setting the color property for each child Shape.

Having a method to update the color for all children would be a useful feature.

Test case: https://codepen.io/alexgoff/pen/vqBLEj

I imagined this component-style behaviour working only if you used copyGraph to copy the item.

Thanks for reporting this issue. This is indeed a bug. I'll look into adding a fix for the next release.

v1.1.0 has been released with this fix added. Closing this issue. Thanks again for reporting 🐶