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

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Tue Feb 18 20:27:25 UTC 2020


 loleaflet/src/map/handler/Map.TouchGesture.js |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 31fe67d205bf04446f7004b11f6dbc278ff630cb
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Tue Feb 18 15:17:35 2020 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Tue Feb 18 21:27:05 2020 +0100

    tdf#130203: mobile: limit the zoom value when pinch events
    
    The argument e.scale, sometimes has the value infinity
    and it breaks the pinch states
    
    Change-Id: I25ec3535024bf4091eb09741a2183178f4ffba20
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88982
    Tested-by: Henry Castro <hcastro at collabora.com>
    Reviewed-by: Henry Castro <hcastro at collabora.com>

diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js
index 0d972d58a..3259f94d5 100644
--- a/loleaflet/src/map/handler/Map.TouchGesture.js
+++ b/loleaflet/src/map/handler/Map.TouchGesture.js
@@ -530,7 +530,7 @@ L.Map.TouchGesture = L.Handler.extend({
 		// we need to invert the offset or the map is moved in the opposite direction
 		var offset = {x: e.center.x - this._pinchStartCenter.x, y: e.center.y - this._pinchStartCenter.y};
 		var center = {x: this._pinchStartCenter.x - offset.x, y: this._pinchStartCenter.y - offset.y};
-		this._zoom = this._map.getScaleZoom(e.scale);
+		this._zoom = this._map._limitZoom(this._map.getScaleZoom(e.scale));
 		this._center = this._map._limitCenter(this._map.mouseEventToLatLng({clientX: center.x, clientY: center.y}),
 						      this._zoom, this._map.options.maxBounds);
 
@@ -570,6 +570,8 @@ L.Map.TouchGesture = L.Handler.extend({
 					annotations.update();
 				}, 250 /* ms */);
 		}
+
+		this._pinchStartCenter = undefined;
 	},
 
 	_constructFakeEvent: function (evt, type) {


More information about the Libreoffice-commits mailing list