loleaflet/src/control/Control.Scroll.js |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 67793ef9ece4a44bccd7cd3ee739990511919a51
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Thu Nov 28 14:33:20 2019 +0200
Commit:     Tor Lillqvist <t...@collabora.com>
CommitDate: Thu Nov 28 14:00:58 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>

diff --git a/loleaflet/src/control/Control.Scroll.js 
b/loleaflet/src/control/Control.Scroll.js
index ab3fc47c6..563711761 100644
--- a/loleaflet/src/control/Control.Scroll.js
+++ b/loleaflet/src/control/Control.Scroll.js
@@ -239,16 +239,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 (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

Reply via email to