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

New commits:
commit 06930ce40953e0d52df19d8ad7a670091a5049a4
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Fri Oct 5 20:56:18 2018 -0400
Commit:     Jan Holesovsky <ke...@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.bu...@collabora.com>
    Tested-by: Aron Budea <aron.bu...@collabora.com>
    Reviewed-by: Jan Holesovsky <ke...@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) {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to