diff --git a/src/data/AutoScroll.js b/src/data/AutoScroll.js index a5779cd..fa9d66d 100644 --- a/src/data/AutoScroll.js +++ b/src/data/AutoScroll.js @@ -96,7 +96,10 @@ chrome.storage.local.get(defaults, function (options) { dirY: 0, click: false, - scrolling: false + scrolling: false, + + wheelX: 0, + wheelY: 0 } var htmlNamespace = "http://www.w3.org/1999/xhtml" @@ -137,6 +140,11 @@ chrome.storage.local.get(defaults, function (options) { scrollY = scrollHeight } + scrollX += (state.wheelX) + scrollY += (state.wheelY) + state.wheelX = 0 + state.wheelY = 0 + // This is needed to support SVG if (root) { // This triggers a reflow @@ -191,6 +199,8 @@ chrome.storage.local.get(defaults, function (options) { function mousewheel(event) { // TODO is this a good idea ? stopEvent(event, true) + state.wheelX += event.deltaX + state.wheelY += event.deltaY } function mousemove(event) {