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

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 20 15:31:38 UTC 2019


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

New commits:
commit 2ba4becb75ec2c72931260d8e3892a06c0546f38
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Sat Jul 13 15:38:59 2019 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Tue Aug 20 17:31:19 2019 +0200

    loleaflet: mobile: limit the center point with max bounds when zooming
    
    Change-Id: Ic2a3823204a717cb17057f5d8b4e25efea2c7759
    Reviewed-on: https://gerrit.libreoffice.org/77847
    Reviewed-by: Henry Castro <hcastro at collabora.com>
    Tested-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 3171e2794..6081c8539 100644
--- a/loleaflet/src/map/handler/Map.TouchGesture.js
+++ b/loleaflet/src/map/handler/Map.TouchGesture.js
@@ -341,8 +341,9 @@ 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._center = this._map.mouseEventToLatLng({clientX: center.x, clientY: center.y});
 			this._zoom = 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);
 
 			L.Util.cancelAnimFrame(this._animRequest);
 			this._animRequest = L.Util.requestAnimFrame(function () {


More information about the Libreoffice-commits mailing list