[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - loleaflet/src
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Mar 4 15:13:14 UTC 2019
loleaflet/src/layer/tile/TileLayer.js | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
New commits:
commit 7cdb5300fb6d7dd2b31877d21bbf3e28df9b0832
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Mon Feb 11 13:55:06 2019 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Mar 4 16:12:55 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 <tml at collabora.com>
Tested-by: Tor Lillqvist <tml at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/68334
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 6ac7ad501..b4ab51f21 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1996,18 +1996,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);
More information about the Libreoffice-commits
mailing list