remove the image loaded check for nodes without images in extract_uinodes (#7280)
## Problem `extract_uinodes` checks if an image is loaded for nodes without images ## Solution Move the image loading skip check so that it is only performed for nodes with a `UiImage` component.
This commit is contained in:
		
							parent
							
								
									2027af4c54
								
							
						
					
					
						commit
						cab065bad4
					
				| @ -203,22 +203,20 @@ pub fn extract_uinodes( | |||||||
|         if let Ok((uinode, transform, color, maybe_image, visibility, clip)) = |         if let Ok((uinode, transform, color, maybe_image, visibility, clip)) = | ||||||
|             uinode_query.get(*entity) |             uinode_query.get(*entity) | ||||||
|         { |         { | ||||||
|             if !visibility.is_visible() { |             // Skip invisible and completely transparent nodes
 | ||||||
|  |             if !visibility.is_visible() || color.0.a() == 0.0 { | ||||||
|                 continue; |                 continue; | ||||||
|             } |             } | ||||||
|  | 
 | ||||||
|             let (image, flip_x, flip_y) = if let Some(image) = maybe_image { |             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) |                 (image.texture.clone_weak(), image.flip_x, image.flip_y) | ||||||
|             } else { |             } else { | ||||||
|                 (DEFAULT_IMAGE_HANDLE.typed().clone_weak(), false, false) |                 (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 { |             extracted_uinodes.uinodes.push(ExtractedUiNode { | ||||||
|                 stack_index, |                 stack_index, | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 ickshonpe
						ickshonpe