loleaflet/src/map/handler/Map.TouchGesture.js |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

New commits:
commit c43aeb3e35a99c2f35bb817037d2451dc8731ae5
Author:     mert <mert.tu...@collabora.com>
AuthorDate: Wed Sep 16 17:31:46 2020 +0300
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Sep 21 17:20:06 2020 +0200

    Fix pinch gesture causes hammer to stuck on Mobile
    
    Change-Id: If0ae311346a1111e9c9935ebacde3bc5ea874833
    Signed-off-by: mert <mert.tu...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102873
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js 
b/loleaflet/src/map/handler/Map.TouchGesture.js
index 689e9104f..ce3ca184e 100644
--- a/loleaflet/src/map/handler/Map.TouchGesture.js
+++ b/loleaflet/src/map/handler/Map.TouchGesture.js
@@ -53,9 +53,20 @@ L.Map.TouchGesture = L.Handler.extend({
                        var tripleTap = new Hammer.Tap({event: 'tripletap', 
taps: 3, posThreshold: posThreshold });
                        this._hammer.add(tripleTap);
                        tripleTap.recognizeWith([doubleTap, singleTap]);
-
+                       var hammer = this._hammer;
                        if (L.Browser.touch) {
-                               L.DomEvent.on(this._map._mapPane, 'touchstart 
touchmove touchend touchcancel', L.DomEvent.preventDefault);
+                               L.DomEvent.on(this._map._mapPane, 'touchstart 
touchmove touchcancel', L.DomEvent.preventDefault);
+                               L.DomEvent.on(this._map._mapPane, 'touchend', 
function(e) {
+                                       // sometimes inputs get stuck in hammer 
and further events get mixed with the old ones
+                                       // this causes to a failure to use all 
the gestures properly.
+                                       // This is a workaround until it is 
fixed by hammer.js
+                                       if (hammer.input) {
+                                               if (hammer.input.store)  {
+                                                       hammer.input.store = [];
+                                               }
+                                       }
+                                       L.DomEvent.preventDefault(e);
+                               });
                        }
 
                        if (Hammer.prefixed(window, 'PointerEvent') !== 
undefined) {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to