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

fix change detection in hierarchy ui #183

Merged

Conversation

aarthificial
Copy link
Contributor

@aarthificial aarthificial commented Feb 11, 2024

Fixes a bug where hierarchy_ui doesn't return true when the selection is modified by clicking on a nested entity.
This problem can be reproduced by running the egui_dock exmaple:

cargo run --example egui_dock
  1. Expand the Pbr Mesh (6v0) entity on the left
  2. Select any resource in Resources
  3. Click on the nested PointLight (7v0) on the left

Doing so should update the inspector to display information about the point light but it doesn't because hierarchy_ui doesn't return true in this case:

let selected = hierarchy_ui(self.world, ui, self.selected_entities);
if selected {
*self.selection = InspectorSelection::Entities;
}

@jakobhellermann jakobhellermann merged commit 71eb2db into jakobhellermann:main Feb 15, 2024
1 check passed
@jakobhellermann
Copy link
Owner

Thanks!

@aarthificial aarthificial deleted the change-detection-fix branch February 16, 2024 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants