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

Henry Castro hcastro at collabora.com
Thu Jan 18 12:50:55 UTC 2018


 loleaflet/src/layer/tile/ImpressTileLayer.js |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit d43b656128fc77b7dde191ce686fe5b78770bea0
Author: Henry Castro <hcastro at collabora.com>
Date:   Wed Jan 17 09:31:26 2018 -0400

    loleaflet: fix first top annotation in Impress
    
    Change-Id: I00afba0ab1696c22f910530154c5f7e8b8fef06f
    Reviewed-on: https://gerrit.libreoffice.org/48051
    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 e20ff78a..b8731417 100644
--- a/loleaflet/src/layer/tile/ImpressTileLayer.js
+++ b/loleaflet/src/layer/tile/ImpressTileLayer.js
@@ -207,13 +207,17 @@ L.ImpressTileLayer = L.TileLayer.extend({
 	},
 
 	layoutAnnotations: function () {
+		var topAnnotation;
 		var annotations = this._annotations[this._partHashes[this._selectedPart]];
 		var topRight = this._map.latLngToLayerPoint(this._map.options.docBounds.getNorthEast())
 			.add(L.point((this._selectedAnnotation ? 3 : 2) * this.options.marginX, this.options.marginY));
-		var topAnnotation = this._topAnnotation[this._selectedPart];
 		var bounds, annotation;
 		for (var index in annotations) {
 			annotation = annotations[index];
+			if (!this._topAnnotation[this._selectedPart]) {
+				this._topAnnotation[this._selectedPart] = 0;
+			}
+			topAnnotation = this._topAnnotation[this._selectedPart];
 			if (topAnnotation > 0 && parseInt(index) === topAnnotation - 1) {
 				// if the top annotation is not the first one, show a bit of the bottom of the previous annotation
 				// so that the user gets aware that there are more annotations above.


More information about the Libreoffice-commits mailing list