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

Updating Box properties does not update faces #65

Closed
alexgoff opened this issue Jun 9, 2019 · 3 comments
Closed

Updating Box properties does not update faces #65

alexgoff opened this issue Jun 9, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@alexgoff
Copy link

alexgoff commented Jun 9, 2019

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

@chrisgannon
Copy link

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

@desandro desandro added the bug Something isn't working label Jun 10, 2019
@desandro
Copy link
Member

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

@desandro desandro changed the title Set properties for children of a shape Updating Box properties does not update faces Jun 13, 2019
desandro added a commit that referenced this issue Jun 14, 2019
fix bug updating Box properties to update faces
@desandro
Copy link
Member

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

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

3 participants