loleaflet/src/control/Control.Scroll.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
New commits: commit 317afcecb4f5c691817c9675bb9711781ef81f9c Author: Tor Lillqvist <t...@collabora.com> AuthorDate: Thu Nov 28 14:33:20 2019 +0200 Commit: Tor Lillqvist <t...@collabora.com> CommitDate: Tue Dec 10 07:51:24 2019 +0100 Improve ruler behaviour when panning by dragging on a touch device Fire the 'scrolloffset' event also in L.Control.Scroll._onUpdateScrollOffset(), which gets called when panning a text document on a touch device. There are still glitches in updating the ruler when one uses a pinch gesture to zoom the document. But usually after a short moment the ruler snaps into correct state. Change-Id: Ic8dd5139ff49f6fe7961096552f1c7e6cf35356c Reviewed-on: https://gerrit.libreoffice.org/83996 Reviewed-by: Tor Lillqvist <t...@collabora.com> Tested-by: Tor Lillqvist <t...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/84048 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/loleaflet/src/control/Control.Scroll.js b/loleaflet/src/control/Control.Scroll.js index 043302004..91da67f41 100644 --- a/loleaflet/src/control/Control.Scroll.js +++ b/loleaflet/src/control/Control.Scroll.js @@ -241,16 +241,18 @@ L.Control.Scroll = L.Control.extend({ _onUpdateScrollOffset: function (e) { // used on window resize + // also when dragging + var offset = new L.Point(e.x - this._prevScrollX, e.y - this._prevScrollY); + if (offset.x === 0) { + offset.x = 1; + } + if (offset.y === 0) { + offset.y = 1; + } if (e.updateHeaders && this._map._docLayer._docType === 'spreadsheet') { - var offset = new L.Point(e.x - this._prevScrollX, e.y - this._prevScrollY); - if (offset.x === 0) { - offset.x = 1; - } - if (offset.y === 0) { - offset.y = 1; - } this._onUpdateRowColumnHeaders({x: e.x, y: e.y, offset: offset}); } + this._map.fire('scrolloffset', offset); this._ignoreScroll = null; $('.scroll-container').mCustomScrollbar('stop'); this._prevScrollY = e.y; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits