diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-02-11 11:24:59 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-02-11 11:27:19 -0800 |
commit | 8a5ba3478c7ced2916a768a9071ef11815fb2773 (patch) | |
tree | 200cf58273a57ad05792b7aba2455ba823267c8b /src/library_glfw.js | |
parent | 5c53a8fe91f6e133337a6b2f3dcbf28eed86b234 (diff) |
refactor mouse wheel handling code to be shared across SDL, glfw, glut
Diffstat (limited to 'src/library_glfw.js')
-rw-r--r-- | src/library_glfw.js | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/library_glfw.js b/src/library_glfw.js index 17e8956a..b54205ad 100644 --- a/src/library_glfw.js +++ b/src/library_glfw.js @@ -197,13 +197,7 @@ var LibraryGLFW = { }, onMouseWheel: function(event) { - if (event.detail > 0) { - GLFW.wheelPos++; - } - - if (event.detail < 0) { - GLFW.wheelPos--; - } + GLFW.wheelPos += Browser.getMouseWheelDelta(event); if (GLFW.mouseWheelFunc && event.target == Module["canvas"]) { Runtime.dynCall('vi', GLFW.mouseWheelFunc, [GLFW.wheelPos]); |