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 55720cfd4d
commit 5b7ad0f4c9
2 changed files with 10 additions and 6 deletions

View File

@ -22,7 +22,6 @@ componentconstructors['chatballoon'] = function(dynmap, configuration) {
return;
}
var popupPosition = dynmap.getProjection().fromLocationToLatLng(player.location);
console.log('popupPosition', popupPosition);
var popup = me.chatpopups[message.name];
if (!popup) {
me.chatpopups[message.name] = popup = {

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') {