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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Oct 9 19:47:44 UTC 2018


 loleaflet/src/map/handler/Map.Drag.js |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 95b10e27b4d694830fde7961af390fa704584876
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Fri Oct 5 20:56:18 2018 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Tue Oct 9 15:46:35 2018 -0400

    loleaflet: mobile: fix the dragging of the map when the size ...
    
    fits with the maximum bounds
    
    Change-Id: Ib30afed8f8a8538a438b70e3983fb1c55baf9d42

diff --git a/loleaflet/src/map/handler/Map.Drag.js b/loleaflet/src/map/handler/Map.Drag.js
index 191516f50..f95e05f96 100644
--- a/loleaflet/src/map/handler/Map.Drag.js
+++ b/loleaflet/src/map/handler/Map.Drag.js
@@ -85,9 +85,15 @@ L.Map.Drag = L.Handler.extend({
 
 	_onPreDrag: function () {
 		var org = this._map.getPixelOrigin();
+		var pos = this._map._getMapPanePos();
 		var size = this._map.getLayerMaxBounds().getSize().subtract(this._map.getSize());
-		this._draggable._newPos.x = Math.max(Math.min(org.x, this._draggable._newPos.x), org.x - size.x);
-		this._draggable._newPos.y = Math.max(Math.min(org.y, this._draggable._newPos.y), org.y - size.y);
+		if (this._draggable._newPos.x !== pos.x) {
+			this._draggable._newPos.x = Math.max(Math.min(org.x, this._draggable._newPos.x), org.x - Math.max(size.x, 0));
+		}
+
+		if (this._draggable._newPos.y !== pos.y) {
+			this._draggable._newPos.y = Math.max(Math.min(org.y, this._draggable._newPos.y), org.y - Math.max(size.y, 0));
+		}
 	},
 
 	_onDragEnd: function (e) {


More information about the Libreoffice-commits mailing list