Remove the With<Parent> query filter from bevy_ui::render::extract_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 <mockersf@gmail.com>
This commit is contained in:
ickshonpe 2023-07-31 21:33:17 +01:00 committed by GitHub
parent fb19b81e40
commit da59de956f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -276,7 +276,7 @@ pub fn extract_uinode_borders(
Without<ContentSize>, Without<ContentSize>,
>, >,
>, >,
parent_node_query: Extract<Query<&Node, With<Parent>>>, node_query: Extract<Query<&Node>>,
) { ) {
let image = bevy_render::texture::DEFAULT_IMAGE_HANDLE.typed(); let image = bevy_render::texture::DEFAULT_IMAGE_HANDLE.typed();
@ -304,7 +304,7 @@ pub fn extract_uinode_borders(
// Both vertical and horizontal percentage border values are calculated based on the width of the parent node // Both vertical and horizontal percentage border values are calculated based on the width of the parent node
// <https://developer.mozilla.org/en-US/docs/Web/CSS/border-width> // <https://developer.mozilla.org/en-US/docs/Web/CSS/border-width>
let parent_width = parent let parent_width = parent
.and_then(|parent| parent_node_query.get(parent.get()).ok()) .and_then(|parent| node_query.get(parent.get()).ok())
.map(|parent_node| parent_node.size().x) .map(|parent_node| parent_node.size().x)
.unwrap_or(ui_logical_viewport_size.x); .unwrap_or(ui_logical_viewport_size.x);
let left = let left =