Skip to content

Commit

Permalink
fixed event handling for firefox.
Browse files Browse the repository at this point in the history
  • Loading branch information
KojiNakamaru committed May 26, 2014
1 parent 485d0a2 commit 56a0e9e
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions tmpl/js/test-html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,13 +468,12 @@
x = t.pageX;
y = t.pageY;
} else {
x = e.offsetX;
y = e.offsetY;
}
if (isMobile) {
x -= stage.offsetLeft;
y -= stage.offsetTop;
x = e.clientX;
y = e.clientY;
}
var r = stage.getBoundingClientRect();
x -= r.left;
y -= r.top;
x /= stage_scale;
y /= stage_scale;
lwf.inputPoint(x, y);
Expand All @@ -492,13 +491,12 @@
x = t.pageX;
y = t.pageY;
} else {
x = e.offsetX;
y = e.offsetY;
}
if (isMobile) {
x -= stage.offsetLeft;
y -= stage.offsetTop;
x = e.clientX;
y = e.clientY;
}
var r = stage.getBoundingClientRect();
x -= r.left;
y -= r.top;
x /= stage_scale;
y /= stage_scale;
lwf.inputPoint(x, y);
Expand Down

0 comments on commit 56a0e9e

Please sign in to comment.