Fix IE exceptions from debug code, canvas calls

This commit is contained in:
Mike Primm 2011-08-15 10:09:14 +08:00 committed by mikeprimm
parent 8c685d2fd8
commit 7465fbcc28
2 changed files with 10 additions and 6 deletions

View file

@ -22,11 +22,16 @@ function createMinecraftHead(player,completed,failed) {
var headCanvas = document.createElement('canvas');
headCanvas.width = 8;
headCanvas.height = 8;
var headContext = headCanvas.getContext('2d');
blitImage(headContext, skinImage, 8,8,8,8, 0,0,8,8);
// Turn off accessory face overlay - causes white faces, and very few skins seem to have them anyway
//blitImage(headContext, skinImage, 40,8,8,8, 0,0,8,8);
completed(headCanvas);
if(headCanvas.getContext) {
var headContext = headCanvas.getContext('2d');
blitImage(headContext, skinImage, 8,8,8,8, 0,0,8,8);
// Turn off accessory face overlay - causes white faces, and very few skins seem to have them anyway
//blitImage(headContext, skinImage, 40,8,8,8, 0,0,8,8);
completed(headCanvas);
}
else {
failed();
}
};
skinImage.onerror = function() {
if (skinImage.src == '//www.minecraft.net/img/char.png') {