From f5ce208b3a8916d5d1dd6649f38f3195bfb547a6 Mon Sep 17 00:00:00 2001 From: Felix Palmer Date: Tue, 12 Nov 2024 13:10:55 +0100 Subject: [PATCH] fix(gltf): Copy across ImageBitmap in deepCopy --- modules/gltf/src/gltf/gltf-instantiator.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/gltf/src/gltf/gltf-instantiator.ts b/modules/gltf/src/gltf/gltf-instantiator.ts index 7afe055bb5..bd707f64c1 100644 --- a/modules/gltf/src/gltf/gltf-instantiator.ts +++ b/modules/gltf/src/gltf/gltf-instantiator.ts @@ -215,7 +215,11 @@ export class GLTFInstantiator { /** Deeply copies a JS data structure */ function deepCopy(object: any): any { // don't copy binary data - if (ArrayBuffer.isView(object) || object instanceof ArrayBuffer) { + if ( + ArrayBuffer.isView(object) || + object instanceof ArrayBuffer || + object instanceof ImageBitmap + ) { return object; } if (Array.isArray(object)) {