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

New commits:
commit d43b656128fc77b7dde191ce686fe5b78770bea0
Author: Henry Castro <hcas...@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 <ke...@collabora.com>
    Tested-by: Jan Holesovsky <ke...@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.
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to