From 7311dc99316989bd0b47fec1a3a1266515651c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Matth=C3=A4y?= Date: Sat, 11 Jan 2020 14:27:18 +0100 Subject: [PATCH] Set image source after crossOrigin and event handlers to allow crossOrigin image loading (#1533) --- spine-ts/core/src/SharedAssetManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spine-ts/core/src/SharedAssetManager.ts b/spine-ts/core/src/SharedAssetManager.ts index 9eafdbadb..6902e219b 100644 --- a/spine-ts/core/src/SharedAssetManager.ts +++ b/spine-ts/core/src/SharedAssetManager.ts @@ -114,7 +114,6 @@ module spine { if (!this.queueAsset(clientId, textureLoader, path)) return; let img = new Image(); - img.src = path; img.crossOrigin = "anonymous"; img.onload = (ev) => { this.rawAssets[path] = img; @@ -122,6 +121,7 @@ module spine { img.onerror = (ev) => { this.errors[path] = `Couldn't load image ${path}`; } + img.src = path; } get (clientId: string, path: string) {