loleaflet/src/map/handler/Map.Scroll.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
New commits: commit b7d6fbfb8366810f24c57d8f55ca344549ae1876 Author: Aron Budea <aron.bu...@collabora.com> Date: Sat Aug 12 16:56:02 2017 +0200 loleaflet: enable horizontal scrolling via Shift + mousewheel Change-Id: I3cac65248628042e0150e9f393c89e4fbefb8ed6 Reviewed-on: https://gerrit.libreoffice.org/41088 Reviewed-by: pranavk <pran...@collabora.co.uk> Tested-by: pranavk <pran...@collabora.co.uk> (cherry picked from commit 61acc4ae7d604196d7c4ce289355c027326f07ef) Reviewed-on: https://gerrit.libreoffice.org/43850 Reviewed-by: Jan Holesovsky <ke...@collabora.com> Tested-by: Jan Holesovsky <ke...@collabora.com> diff --git a/loleaflet/src/map/handler/Map.Scroll.js b/loleaflet/src/map/handler/Map.Scroll.js index f7a98f3c..9c584ecc 100644 --- a/loleaflet/src/map/handler/Map.Scroll.js +++ b/loleaflet/src/map/handler/Map.Scroll.js @@ -15,6 +15,7 @@ L.Map.Scroll = L.Handler.extend({ }, this); this._delta = 0; + this._vertical = 1; }, removeHooks: function () { @@ -38,6 +39,12 @@ L.Map.Scroll = L.Handler.extend({ var left = Math.max(debounce - (+new Date() - this._startTime), 0); clearTimeout(this._timer); + if (e.shiftKey) { + this._vertical = 0; + } + else { + this._vertical = 1; + } this._timer = setTimeout(L.bind(this._performScroll, this), left); L.DomEvent.stop(e); @@ -52,7 +59,7 @@ L.Map.Scroll = L.Handler.extend({ this._startTime = null; if (!delta) { return; } - map.fire('scrollby', {x: 0, y: delta * scrollAmount}); + map.fire('scrollby', {x: (1 - this._vertical) * delta * scrollAmount, y: this._vertical * delta * scrollAmount}); } }); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits