Skip to content

Commit

Permalink
fix mousewheel zoom on firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
jeyoder committed May 31, 2015
1 parent 7b0d74b commit a210e45
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion web-root/scripts/main.js
Expand Up @@ -125,7 +125,11 @@ $(document).ready(function() {
});

$('#canvas').on('wheel', function (evt) {
zoomTarget += evt.originalEvent.deltaY * 0.0002;
var delta = evt.originalEvent.deltaY;
if(evt.originalEvent.deltaMode === 1) {
delta *= 33.3333333;
}
zoomTarget += delta * 0.0002;
if(zoomTarget > 1) zoomTarget = 1;
if(zoomTarget < 0) zoomTarget = 0;
});
Expand Down

0 comments on commit a210e45

Please sign in to comment.