File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
crates/bevy_sprite/src/render Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -474,19 +474,15 @@ pub fn prepare_sprites(
474474 z_order = extracted_sprite. transform . translation . z ;
475475 }
476476 // if start != end, there is one last batch to process
477- if white_start != white_end {
477+ let [ start, end] = match current_batch_colored {
478+ true => [ & mut colored_start, & mut colored_end] ,
479+ false => [ & mut white_start, & mut white_end] ,
480+ } ;
481+ if * start != * end {
478482 commands. spawn ( ) . insert ( SpriteBatch {
479- range : white_start..white_end ,
483+ range : * start.. * end ,
480484 image_handle_id : current_batch_handle,
481- colored : false ,
482- z_order,
483- } ) ;
484- }
485- if colored_start != colored_end {
486- commands. spawn ( ) . insert ( SpriteBatch {
487- range : colored_start..colored_end,
488- image_handle_id : current_batch_handle,
489- colored : true ,
485+ colored : current_batch_colored,
490486 z_order,
491487 } ) ;
492488 }
You can’t perform that action at this time.
0 commit comments