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

Henry Castro hcastro at collabora.com
Wed Jan 17 13:38:07 UTC 2018


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

New commits:
commit 7f83f236903f0920ea3d56b715408c497e7e7419
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

diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js
index fdbcc9fc..0917f9ab 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