Skip to content

Commit 43e905b

Browse files
committed
Add crossOrigin attribute to imgs to prevent canvas tainted errors
1 parent bc9e937 commit 43e905b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

js/Sprite.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@ Sprite.prototype.attach = function(scene) {
140140
});
141141
scene.append($(sprite.textures[c]));
142142
})
143-
.attr('src', io.asset_base + this.costumes[c].baseLayerMD5 + io.asset_suffix);
143+
.attr({
144+
'crossOrigin': 'annonymous',
145+
'src': io.asset_base + this.costumes[c].baseLayerMD5 + io.asset_suffix
146+
});
144147
}
145148

146149
this.mesh = this.textures[this.currentCostumeIndex];

0 commit comments

Comments
 (0)