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

remove panics when mixing UI and non UI entities in hierarchy #1180

Merged
merged 2 commits into from
Jan 1, 2021

Conversation

mockersf
Copy link
Member

Remove two unwrap that can happen when having a mix of entities with and without ui components (mainly Node & Style) in a hierarchy, and replace them by a warning and a failover.

I think the log would greatly benefit from a link to a page (official FAQ? GitHub wiki?) describing the problem in more details than what a log can say

if let Ok(parent_layout) = flex_surface.get_layout(parent.0) {
position.x -= to_logical(parent_layout.size.width / 2.0);
position.y -= to_logical(parent_layout.size.height / 2.0);
if parent_flags.changed() || transform_flags.changed() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added this check so that the log doesn't happen every frame

@Moxinilian Moxinilian added C-Feature A new feature, making something new possible A-UI Graphical user interfaces, styles, layouts, and widgets P-Crash A sudden unexpected crash and removed C-Feature A new feature, making something new possible labels Jan 1, 2021
@cart
Copy link
Member

cart commented Jan 1, 2021

This looks good to me. I agree that a link (probably to a section in the Bevy Book faq) would be beneficial, but we might as well merge this now to get the benefits.

@cart cart merged commit c95d0dd into bevyengine:master Jan 1, 2021
@mockersf mockersf deleted the ui-unwrap branch April 27, 2021 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets P-Crash A sudden unexpected crash
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants