From 8cd45cdd9adb8a514ebd2d5dd1c9360e5ed9e3ae Mon Sep 17 00:00:00 2001 From: Wouter lucas van Boesschoten Date: Wed, 20 Dec 2023 19:56:35 +0100 Subject: [PATCH] Perf: Skip rendering of nodes that do not have a width/height property. Except when there is a texture set, this does not require an upfront width/height. Tests: Visual Regression Tests Completed: 28 snapshots passed (100.0%) 28 snapshots tested --- src/core/CoreNode.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/CoreNode.ts b/src/core/CoreNode.ts index b815b9a2..78444b2e 100644 --- a/src/core/CoreNode.ts +++ b/src/core/CoreNode.ts @@ -409,6 +409,10 @@ export class CoreNode extends EventEmitter implements ICoreNode { return (this.isRenderable = true); } + if (!this.props.width || !this.props.height) { + return (this.isRenderable = false); + } + if (this.props.shader) { return (this.isRenderable = true); }