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

[Merged by Bors] - remove the image loaded check for nodes without images in extract_uinodes #7280

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions crates/bevy_ui/src/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,22 +203,20 @@ pub fn extract_uinodes(
if let Ok((uinode, transform, color, maybe_image, visibility, clip)) =
uinode_query.get(*entity)
{
if !visibility.is_visible() {
// Skip invisible and completely transparent nodes
if !visibility.is_visible() || color.0.a() == 0.0 {
continue;
}

let (image, flip_x, flip_y) = if let Some(image) = maybe_image {
// Skip loading images
if !images.contains(&image.texture) {
continue;
}
(image.texture.clone_weak(), image.flip_x, image.flip_y)
} else {
(DEFAULT_IMAGE_HANDLE.typed().clone_weak(), false, false)
};
// Skip loading images
if !images.contains(&image) {
continue;
}
// Skip completely transparent nodes
if color.0.a() == 0.0 {
continue;
}

extracted_uinodes.uinodes.push(ExtractedUiNode {
stack_index,
Expand Down