[Libreoffice-commits] online.git: loleaflet/src

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Sat Jul 6 10:54:50 UTC 2019


 loleaflet/src/control/Control.LokDialog.js |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 066a5439026a0b65f26037e361b6768943fc6eb9
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Thu Jul 4 17:21:08 2019 +0900
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sat Jul 6 12:54:32 2019 +0200

    tdf#124146 fixes for iOS
    
    Change-Id: I67e596ba1f295556eac60c8cfa5b5c43e6273a34
    Reviewed-on: https://gerrit.libreoffice.org/75071
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
    Tested-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js
index c2203d955..bd90e3220 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -59,18 +59,20 @@ L.Control.LokDialog = L.Control.extend({
 
 		if (target) {
 			if (ev.pointers.length == 1) {
+				var delta = -ev.deltaY;
 				if (ev.type == 'panstart') {
-					firstTouchPositionX = ev.pointers[0].offsetX;
-					firstTouchPositionY = ev.pointers[0].offsetY;
-					this._postWindowGestureEvent(dialogID, 'panBegin', firstTouchPositionX, firstTouchPositionY, ev.deltaY);
+					var rect = ev.target.getBoundingClientRect();
+					firstTouchPositionX = ev.center.x - rect.x;
+					firstTouchPositionY = ev.center.y - rect.y;
+					this._postWindowGestureEvent(dialogID, 'panBegin', firstTouchPositionX, firstTouchPositionY, delta);
 				}
 				else if (ev.type == 'panstop') {
-					this._postWindowGestureEvent(dialogID, 'panEnd', firstTouchPositionX, firstTouchPositionY, ev.deltaY);
+					this._postWindowGestureEvent(dialogID, 'panEnd', firstTouchPositionX, firstTouchPositionY, delta);
 					firstTouchPositionX = null;
 					firstTouchPositionY = null;
 				}
 				else {
-					this._postWindowGestureEvent(dialogID, 'panUpdate', firstTouchPositionX, firstTouchPositionY, ev.deltaY);
+					this._postWindowGestureEvent(dialogID, 'panUpdate', firstTouchPositionX, firstTouchPositionY, delta);
 				}
 			}
 			else {


More information about the Libreoffice-commits mailing list