@@ -489,34 +489,38 @@ pub fn prepare_uinodes(
489
489
continue ;
490
490
}
491
491
}
492
+ let uvs = if current_batch_handle. id ( ) == DEFAULT_IMAGE_HANDLE . id ( ) {
493
+ [ Vec2 :: ZERO , Vec2 :: X , Vec2 :: ONE , Vec2 :: Y ]
494
+ } else {
495
+ let atlas_extent = extracted_uinode. atlas_size . unwrap_or ( uinode_rect. max ) ;
496
+ let mut uvs = [
497
+ Vec2 :: new (
498
+ uinode_rect. min . x + positions_diff[ 0 ] . x ,
499
+ uinode_rect. min . y + positions_diff[ 0 ] . y ,
500
+ ) ,
501
+ Vec2 :: new (
502
+ uinode_rect. max . x + positions_diff[ 1 ] . x ,
503
+ uinode_rect. min . y + positions_diff[ 1 ] . y ,
504
+ ) ,
505
+ Vec2 :: new (
506
+ uinode_rect. max . x + positions_diff[ 2 ] . x ,
507
+ uinode_rect. max . y + positions_diff[ 2 ] . y ,
508
+ ) ,
509
+ Vec2 :: new (
510
+ uinode_rect. min . x + positions_diff[ 3 ] . x ,
511
+ uinode_rect. max . y + positions_diff[ 3 ] . y ,
512
+ ) ,
513
+ ]
514
+ . map ( |pos| pos / atlas_extent) ;
492
515
493
- let atlas_extent = extracted_uinode. atlas_size . unwrap_or ( uinode_rect. max ) ;
494
- let mut uvs = [
495
- Vec2 :: new (
496
- uinode_rect. min . x + positions_diff[ 0 ] . x ,
497
- uinode_rect. min . y + positions_diff[ 0 ] . y ,
498
- ) ,
499
- Vec2 :: new (
500
- uinode_rect. max . x + positions_diff[ 1 ] . x ,
501
- uinode_rect. min . y + positions_diff[ 1 ] . y ,
502
- ) ,
503
- Vec2 :: new (
504
- uinode_rect. max . x + positions_diff[ 2 ] . x ,
505
- uinode_rect. max . y + positions_diff[ 2 ] . y ,
506
- ) ,
507
- Vec2 :: new (
508
- uinode_rect. min . x + positions_diff[ 3 ] . x ,
509
- uinode_rect. max . y + positions_diff[ 3 ] . y ,
510
- ) ,
511
- ]
512
- . map ( |pos| pos / atlas_extent) ;
513
-
514
- if extracted_uinode. flip_x {
515
- uvs = [ uvs[ 1 ] , uvs[ 0 ] , uvs[ 3 ] , uvs[ 2 ] ] ;
516
- }
517
- if extracted_uinode. flip_y {
518
- uvs = [ uvs[ 3 ] , uvs[ 2 ] , uvs[ 1 ] , uvs[ 0 ] ] ;
519
- }
516
+ if extracted_uinode. flip_x {
517
+ uvs = [ uvs[ 1 ] , uvs[ 0 ] , uvs[ 3 ] , uvs[ 2 ] ] ;
518
+ }
519
+ if extracted_uinode. flip_y {
520
+ uvs = [ uvs[ 3 ] , uvs[ 2 ] , uvs[ 1 ] , uvs[ 0 ] ] ;
521
+ }
522
+ uvs
523
+ } ;
520
524
521
525
let color = extracted_uinode. color . as_linear_rgba_f32 ( ) ;
522
526
for i in QUAD_INDICES {
0 commit comments