-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 the With<Parent>
query filter from bevy_ui::render::extract_uinode_borders
#9285
Remove the With<Parent>
query filter from bevy_ui::render::extract_uinode_borders
#9285
Conversation
Removed the `With<Parent>` query filter from `parent_node_query`. This is a minor bug, it is meant to be a query to retrieve the size of the current node's parent, not a query for a node with a parent.
With<Parent>
query filter from bevy_ui::render::extract_uinode_borders
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but I have a naive question: when do we check the coherence of a hierarchy and when do we not do it? propagate_transforms
does it for example, but maybe it's only to prevent an infinite recursion?
crates/bevy_ui/src/render/mod.rs
Outdated
@@ -277,7 +277,7 @@ pub fn extract_uinode_borders( | |||
Without<ContentSize>, | |||
>, | |||
>, | |||
parent_node_query: Extract<Query<&Node, With<Parent>>>, | |||
parent_node_query: Extract<Query<&Node>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parent_node_query: Extract<Query<&Node>>, | |
node_query: Extract<Query<&Node>>, |
and also where it's used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, since it's the query used to get the parent, it makes sense to be named "parent_node_query"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to name it based on what is is, not where it's used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to name it based on what is is, not where it's used
agreed I think, but keep the name parent_node
for the value retrieved from the query, where it is the actual Node component of the parent.
It does it because it would be unsound use of unsafe if the hierarchy is improperly structured, due to the mutable access on multiple threads. |
Co-authored-by: François <[email protected]>
There are also checks in |
@ickshonpe I think the rename was incomplete: CI failures look real. Once CI is passing this will be merged! |
Ah yep I see, I'll fix it now. |
…_uinode_borders` (#9285) # Objective Remove the `With<Parent>` query filter from the `parent_node_query` parameter of the `bevy_ui::render::extract_uinode_borders` function. This is a bug, the query is only used to retrieve the size of the current node's parent. We don't care if that parent node has a `Parent` or not. --------- Co-authored-by: François <[email protected]>
Objective
Remove the
With<Parent>
query filter from theparent_node_query
parameter of thebevy_ui::render::extract_uinode_borders
function. This is a bug, the query is only used to retrieve the size of the current node's parent. We don't care if that parent node has aParent
or not.