Skip to content

Commit

Permalink
El canvas por fin funciona en Firefox. Fixed #12
Browse files Browse the repository at this point in the history
  • Loading branch information
lhchavez committed Oct 8, 2013
1 parent 6cf6321 commit d77b8b6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,13 @@ $(document).ready(function(){
});
$("#world").click(function(event){
$("#wcontext_menu").css("display", "none");
var x = event.offsetX;
var y = event.offsetY;
// Firefox no reconoce offsetX. UGH.
var x = event.offsetX ||
(event.clientX + document.body.scrollLeft +
document.documentElement.scrollLeft - $('#world').offset().left);
var y = event.offsetY ||
(event.clientY + document.body.scrollTop +
document.documentElement.scrollTop - $('#world').offset().top);
//Maneja los clicks en el mundo
if ((world.width-50)<=x && x <=(world.width-20) && 10<=y && y<=40) {
//NORTE
Expand Down

0 comments on commit d77b8b6

Please sign in to comment.