loleaflet/src/layer/tile/CalcTileLayer.js |    7 +++++++
 loleaflet/src/layer/tile/TileLayer.js     |    5 +++++
 2 files changed, 12 insertions(+)

New commits:
commit 9305d75362e56a76e9d95735b626a32157ea88a4
Author:     Dennis Francis <dennis.fran...@collabora.com>
AuthorDate: Tue Aug 11 11:54:48 2020 +0530
Commit:     Dennis Francis <dennis.fran...@collabora.com>
CommitDate: Wed Aug 12 10:37:14 2020 +0200

    loleaflet: adjust the map position on resize...
    
    ... if there is an active/visible cursor *and* it is out of the visible
    map-area. The map position is so adjusted that the cursor will in the
    center of the visible map area. This is needed for mobile(at least
    android) because of the on-screen keyboard.
    
    Note: We already do this for every 'invalidatecursor' message.
    Change-Id: I3342a165ad47fe1b32715f3a6bf35486ba2f287c
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100489
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Tested-by: Jenkins
    Reviewed-by: Dennis Francis <dennis.fran...@collabora.com>

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 0c25bd78a..337ba0f68 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -80,6 +80,13 @@ L.CalcTileLayer = (L.Browser.mobile ? L.TileLayer : 
L.CanvasTileLayer).extend({
                map.addControl(L.control.columnHeader());
                map.addControl(L.control.rowHeader());
                L.TileLayer.prototype.onAdd.call(this, map);
+
+               map.on('resize', function () {
+                       if (this.isCursorVisible()) {
+                               this._onUpdateCursor(true /* scroll */);
+                       }
+               }.bind(this));
+
                this._annotations = {};
        },
 
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index e0f1b8d37..71340ad89 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2263,6 +2263,11 @@ L.TileLayer = L.GridLayer.extend({
 
        // Update cursor layer (blinking cursor).
        _onUpdateCursor: function (scroll, zoom) {
+
+               if (!this._visibleCursor) {
+                       return;
+               }
+
                var cursorPos = this._visibleCursor.getNorthWest();
                var docLayer = this._map._docLayer;
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to