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

UI component bundles derive clone #390

Merged
merged 7 commits into from
Aug 29, 2020

Conversation

ashneverdawn
Copy link
Contributor

The UI component bundles and a few of their components weren't Clone, so when using .with_children(|parent| {...}) they had to be constructed directly within the closure. Now that they implement Clone, the data can be manipulated ahead of time and then moved into the closure with .clone()

@memoryruins
Copy link
Contributor

To work around this, I have been using closures/functions for manipulating ahead of time then re-using for multiple nodes, but in many places, manipulating a local ahead of time then using Clone would have been more natural. I appreciate you looking into this!

@cart
Copy link
Member

cart commented Aug 29, 2020

Yup this is a nice usability win. Thanks!

@cart cart merged commit 00be5d0 into bevyengine:master Aug 29, 2020
@karroffel karroffel added C-Code-Quality A section of code that is hard to understand or change A-ECS Entities, components, systems, and events labels Aug 30, 2020
mrk-its pushed a commit to mrk-its/bevy that referenced this pull request Oct 6, 2020
make Draw, TextStyle, and the rest of the ui components derive clone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Code-Quality A section of code that is hard to understand or change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants