@@ -728,7 +728,6 @@ export class CoreNode extends EventEmitter {
728728 valid : false ,
729729 } ;
730730 public textureCoords ?: TextureCoords ;
731- public updateTextureCoords : boolean = false ;
732731 public updateShaderUniforms : boolean = false ;
733732 public isRenderable = false ;
734733 public renderState : CoreNodeRenderState = CoreNodeRenderState . Init ;
@@ -901,6 +900,13 @@ export class CoreNode extends EventEmitter {
901900 } satisfies NodeTextureLoadedPayload ) ;
902901 }
903902
903+ if (
904+ this . stage . calculateTextureCoord === true &&
905+ this . props . textureOptions !== null
906+ ) {
907+ this . textureCoords = this . stage . renderer . getTextureCoords ! ( this ) ;
908+ }
909+
904910 // Trigger a local update if the texture is loaded and the resizeMode is 'contain'
905911 if ( this . props . textureOptions ?. resizeMode ?. type === 'contain' ) {
906912 this . setUpdateType ( UpdateType . Local ) ;
@@ -1261,11 +1267,6 @@ export class CoreNode extends EventEmitter {
12611267 this . sortChildren ( ) ;
12621268 }
12631269
1264- if ( this . updateTextureCoords === true ) {
1265- this . updateTextureCoords = false ;
1266- this . textureCoords = this . stage . renderer . getTextureCoords ! ( this ) ;
1267- }
1268-
12691270 // If we're out of bounds, apply the render state now
12701271 // this is done so nodes can finish their entire update loop before
12711272 // being marked as out of bounds
@@ -1497,14 +1498,6 @@ export class CoreNode extends EventEmitter {
14971498 isRenderable,
14981499 } satisfies NodeRenderablePayload ) ;
14991500 }
1500-
1501- if (
1502- isRenderable === true &&
1503- this . stage . calculateTextureCoord === true &&
1504- this . textureCoords === undefined
1505- ) {
1506- this . updateTextureCoords = true ;
1507- }
15081501 }
15091502
15101503 /**
@@ -1704,6 +1697,8 @@ export class CoreNode extends EventEmitter {
17041697 const t = this . globalTransform ! ;
17051698 const coords = this . renderCoords ;
17061699 const texture = p . texture || this . stage . defaultTexture ;
1700+ const textureCoords =
1701+ this . textureCoords || this . stage . renderer . defaultTextureCoords ;
17071702
17081703 // There is a race condition where the texture can be null
17091704 // with RTT nodes. Adding this defensively to avoid errors.
@@ -1720,7 +1715,7 @@ export class CoreNode extends EventEmitter {
17201715 colorBr : this . premultipliedColorBr ,
17211716 texture,
17221717 textureOptions : p . textureOptions ,
1723- textureCoords : this . textureCoords ,
1718+ textureCoords : textureCoords ,
17241719 shader : p . shader as CoreShaderNode < any > ,
17251720 alpha : this . worldAlpha ,
17261721 clippingRect : this . clippingRect ,
@@ -1797,7 +1792,6 @@ export class CoreNode extends EventEmitter {
17971792
17981793 set w ( value : number ) {
17991794 if ( this . props . w !== value ) {
1800- this . updateTextureCoords = true ;
18011795 this . props . w = value ;
18021796 this . setUpdateType ( UpdateType . Local ) ;
18031797
@@ -1819,7 +1813,6 @@ export class CoreNode extends EventEmitter {
18191813
18201814 set h ( value : number ) {
18211815 if ( this . props . h !== value ) {
1822- this . updateTextureCoords = true ;
18231816 this . props . h = value ;
18241817 this . setUpdateType ( UpdateType . Local ) ;
18251818
@@ -2430,6 +2423,9 @@ export class CoreNode extends EventEmitter {
24302423
24312424 set textureOptions ( value : TextureOptions ) {
24322425 this . props . textureOptions = value ;
2426+ if ( this . stage . calculateTextureCoord === true && value !== null ) {
2427+ this . textureCoords = this . stage . renderer . getTextureCoords ! ( this ) ;
2428+ }
24332429 }
24342430
24352431 get textureOptions ( ) : TextureOptions {
0 commit comments