loleaflet/src/map/handler/Map.Scroll.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
New commits: commit 61acc4ae7d604196d7c4ce289355c027326f07ef Author: Aron Budea <[email protected]> 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 <[email protected]> Tested-by: pranavk <[email protected]> diff --git a/loleaflet/src/map/handler/Map.Scroll.js b/loleaflet/src/map/handler/Map.Scroll.js index 593e1dfb..08722e02 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 () { @@ -41,7 +42,12 @@ L.Map.Scroll = L.Handler.extend({ if (e.ctrlKey) { this._timer = setTimeout(L.bind(this._performZoom, this), left); } + else if (e.shiftKey) { + this._vertical = 0; + this._timer = setTimeout(L.bind(this._performScroll, this), left); + } else { + this._vertical = 1; this._timer = setTimeout(L.bind(this._performScroll, this), left); } @@ -57,7 +63,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}); }, _performZoom: function () { _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
