diff --git a/examples/index.ts b/examples/index.ts index 5a29a736..efe64795 100644 --- a/examples/index.ts +++ b/examples/index.ts @@ -429,7 +429,7 @@ async function runAutomation( // Allow some time for all images to load and the RaF to unpause // and render if needed. - await waitForRendererIdle(renderer); + await new Promise((resolve) => setTimeout(resolve, 200)); if (snapshot) { console.log(`Calling snapshot(${testName})`); await snapshot(testName, adjustedOptions); diff --git a/src/core/CoreNode.ts b/src/core/CoreNode.ts index 1a18933a..2e2c9845 100644 --- a/src/core/CoreNode.ts +++ b/src/core/CoreNode.ts @@ -812,9 +812,10 @@ export class CoreNode extends EventEmitter { // load default texture if no texture is set if ( this.stage.defaultTexture !== null && - !this.props.src && - !this.props.texture && - !this.props.rtt + this.props.src === null && + this.props.texture === null && + this.props.rtt === false && + this.hasRenderableProperties() === true ) { this.texture = this.stage.defaultTexture; } @@ -849,10 +850,13 @@ export class CoreNode extends EventEmitter { this.notifyParentRTTOfUpdate(); } - this.emit('loaded', { - type: 'texture', - dimensions, - } satisfies NodeTextureLoadedPayload); + // ignore 1x1 pixel textures + if (dimensions.width > 1 && dimensions.height > 1) { + this.emit('loaded', { + type: 'texture', + dimensions, + } satisfies NodeTextureLoadedPayload); + } // Trigger a local update if the texture is loaded and the resizeMode is 'contain' if (this.props.textureOptions?.resizeMode?.type === 'contain') { @@ -1564,7 +1568,7 @@ export class CoreNode extends EventEmitter { assertTruthy(this.globalTransform); assertTruthy(this.renderCoords); - // assertTruthy(this.texture); + assertTruthy(this.texture); // add to list of renderables to be sorted before rendering renderer.addQuad({