loleaflet/src/layer/tile/TileLayer.js |   25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

New commits:
commit 04597b4ec1affc1d5bc57ba2e4e1a3844615a136
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Mon Feb 11 13:55:06 2019 +0200
Commit:     Tor Lillqvist <t...@collabora.com>
CommitDate: Tue Feb 12 09:16:06 2019 +0100

    Hack to make it easier to drag selection handles vertically on touch devices
    
    Change-Id: I33d03d1378ff5bbce094d5de30ab8d51d38efe0d
    Reviewed-on: https://gerrit.libreoffice.org/67685
    Reviewed-by: Tor Lillqvist <t...@collabora.com>
    Tested-by: Tor Lillqvist <t...@collabora.com>

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 7c23669ed..853d7e7be 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1976,18 +1976,21 @@ L.TileLayer = L.GridLayer.extend({
 
                        var expectedPos = L.point(e.originalEvent.pageX, 
e.originalEvent.pageY).subtract(e.target.dragging._draggable.startOffset);
 
-                       // If the map has been scrolled, but the cursor hasn't 
been updated yet, then
-                       // the current mouse position differs.
-                       if (!expectedPos.equals(cursorPos)) {
-                               var correction = 
expectedPos.subtract(cursorPos);
-
-                               e.target.dragging._draggable._startPoint = 
e.target.dragging._draggable._startPoint.add(correction);
-                               e.target.dragging._draggable._startPos = 
e.target.dragging._draggable._startPos.add(correction);
-                               e.target.dragging._draggable._newPos = 
e.target.dragging._draggable._newPos.add(correction);
-
-                               e.target.dragging._draggable._updatePosition();
+                       // Dragging the selection handles vertically more than 
one line on a touch
+                       // device is more or less impossible without this hack.
+                       if (!(typeof e.originalEvent.type === 'string' && 
e.originalEvent.type === 'touchmove')) {
+                               // If the map has been scrolled, but the cursor 
hasn't been updated yet, then
+                               // the current mouse position differs.
+                               if (!expectedPos.equals(cursorPos)) {
+                                       var correction = 
expectedPos.subtract(cursorPos);
+
+                                       
e.target.dragging._draggable._startPoint = 
e.target.dragging._draggable._startPoint.add(correction);
+                                       e.target.dragging._draggable._startPos 
= e.target.dragging._draggable._startPos.add(correction);
+                                       e.target.dragging._draggable._newPos = 
e.target.dragging._draggable._newPos.add(correction);
+
+                                       
e.target.dragging._draggable._updatePosition();
+                               }
                        }
-
                        var containerPos = new L.Point(expectedPos.x - 
this._map._container.getBoundingClientRect().left,
                                expectedPos.y - 
this._map._container.getBoundingClientRect().top);
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to