@@ -18,6 +18,7 @@ use bevy_render::{
18
18
renderer:: { RenderDevice , RenderQueue } ,
19
19
texture:: { BevyDefault , GpuImage , Image , TRANSPARENT_IMAGE_HANDLE } ,
20
20
view:: * ,
21
+ world_sync:: { RenderEntity , TemporaryRenderEntity } ,
21
22
Extract , ExtractSchedule , Render , RenderSet ,
22
23
} ;
23
24
use bevy_sprite:: {
@@ -258,6 +259,7 @@ pub fn extract_ui_texture_slices(
258
259
Option < & TextureAtlas > ,
259
260
) > ,
260
261
> ,
262
+ mapping : Extract < Query < & RenderEntity > > ,
261
263
) {
262
264
for ( uinode, transform, view_visibility, clip, camera, image, image_scale_mode, atlas) in
263
265
& slicers_query
@@ -267,6 +269,10 @@ pub fn extract_ui_texture_slices(
267
269
continue ;
268
270
} ;
269
271
272
+ let Ok ( & camera_entity) = mapping. get ( camera_entity) else {
273
+ continue ;
274
+ } ;
275
+
270
276
// Skip invisible images
271
277
if !view_visibility. get ( )
272
278
|| image. color . is_fully_transparent ( )
@@ -291,7 +297,7 @@ pub fn extract_ui_texture_slices(
291
297
} ;
292
298
293
299
extracted_ui_slicers. slices . insert (
294
- commands. spawn_empty ( ) . id ( ) ,
300
+ commands. spawn ( TemporaryRenderEntity ) . id ( ) ,
295
301
ExtractedUiTextureSlice {
296
302
stack_index : uinode. stack_index ,
297
303
transform : transform. compute_matrix ( ) ,
@@ -302,7 +308,7 @@ pub fn extract_ui_texture_slices(
302
308
} ,
303
309
clip : clip. map ( |clip| clip. clip ) ,
304
310
image : image. texture . id ( ) ,
305
- camera_entity,
311
+ camera_entity : camera_entity . id ( ) ,
306
312
image_scale_mode : image_scale_mode. clone ( ) ,
307
313
atlas_rect,
308
314
flip_x : image. flip_x ,
0 commit comments