Permalink
Browse files

Merge pull request #2 from jgeralnik/master

Game broken in firefox
  • Loading branch information...
2 parents a838e65 + ffb1245 commit 31cbc5f53adddf3c25243bdce507a52d2e098a48 @borismus committed Jul 23, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 client/input.js
View
@@ -52,8 +52,8 @@ DesktopInput.prototype.onleave = function() {
DesktopInput.prototype.onclick = function(event) {
// Get the position of the click.
- var cx = event.offsetX;
- var cy = event.offsetY;
+ var cx = event.clientX - event.target.getBoundingClientRect().left;
+ var cy = event.clientY - event.target.getBoundingClientRect().top;
// Get the current player.
var player = this.game.state.objects[playerId];
// Sometimes the player isn't there.

0 comments on commit 31cbc5f

Please sign in to comment.