[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3' - loleaflet/src

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Nov 8 21:12:48 UTC 2018


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

New commits:
commit 06930ce40953e0d52df19d8ad7a670091a5049a4
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Fri Oct 5 20:56:18 2018 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Thu Nov 8 22:12:31 2018 +0100

    loleaflet: mobile: fix the dragging of the map when the size ...
    
    fits with the maximum bounds
    
    Change-Id: Ib30afed8f8a8538a438b70e3983fb1c55baf9d42
    Reviewed-on: https://gerrit.libreoffice.org/61456
    Reviewed-by: Aron Budea <aron.budea at collabora.com>
    Tested-by: Aron Budea <aron.budea at collabora.com>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/loleaflet/src/map/handler/Map.Drag.js b/loleaflet/src/map/handler/Map.Drag.js
index bb177a3b9..07395e236 100644
--- a/loleaflet/src/map/handler/Map.Drag.js
+++ b/loleaflet/src/map/handler/Map.Drag.js
@@ -84,9 +84,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