Explorar o código

Set image source after crossOrigin and event handlers to allow crossOrigin image loading (#1533)

Matthias Matthäy %!s(int64=5) %!d(string=hai) anos
pai
achega
7311dc9931
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      spine-ts/core/src/SharedAssetManager.ts

+ 1 - 1
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) {