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

Jan Holesovsky (via logerrit) logerrit at kemper.freedesktop.org
Wed Nov 13 14:37:42 UTC 2019


 loleaflet/src/layer/tile/ImpressTileLayer.js |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit 47e9cca4e1ea121b6680795463807e70299766c3
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Wed Jul 3 15:21:12 2019 +0200
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Nov 13 15:37:24 2019 +0100

    Fix cut off comments in Impress.
    
    We need to force the document size recounting in Impress, because the
    document size actually "changes" there on zoom: The annotations are in
    absolute pixels, so when you zoom out, it is as if the absolute-sized
    annotations grew larger, so we have to extend the document size,
    otherwise they are cut off.
    
    But triggering the document size change too early leads to the
    sideeffect that the layer with the cursor and the tiles grid get out of
    sync.
    
    Let's do the same as in writer - react on the 'updatemaxbounds' event,
    and force resize from there.
    
    Change-Id: If84ddf3597be0383ff6ae2271e6ba6ae3bbd5210
    Reviewed-on: https://gerrit.libreoffice.org/82604
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js
index 46379cc67..d35df5aaa 100644
--- a/loleaflet/src/layer/tile/ImpressTileLayer.js
+++ b/loleaflet/src/layer/tile/ImpressTileLayer.js
@@ -290,6 +290,12 @@ L.ImpressTileLayer = L.TileLayer.extend({
 		this._topAnnotation[this._selectedPart] = 0;
 		this._selectedAnnotation = undefined;
 		this._draft = null;
+
+		map.on('updatemaxbounds', this._onUpdateMaxBounds, this);
+	},
+
+	onRemove: function (map) {
+		map.off('updatemaxbounds', this._onUpdateMaxBounds, this);
 	},
 
 	onAnnotationCancel: function () {
@@ -747,5 +753,9 @@ L.ImpressTileLayer = L.TileLayer.extend({
 			extraSize = annotations && annotations.length > 0 ? this.extraSize : null;
 		}
 		L.GridLayer.prototype._updateMaxBounds.call(this, sizeChanged, extraSize, {panInside: false});
+	},
+
+	_onUpdateMaxBounds: function (e) {
+		this._updateMaxBounds(e.sizeChanged, e.extraSize);
 	}
 });


More information about the Libreoffice-commits mailing list