loleaflet/src/layer/AnnotationManager.js     |    3 ++-
 loleaflet/src/layer/tile/ImpressTileLayer.js |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit a759a01c7de89b387943ad4173c9b72cd30581d9
Author: Henry Castro <[email protected]>
Date:   Wed Mar 22 22:32:31 2017 -0400

    loleaflet: ensure visible element before getting bounds
    
    Change-Id: Iae66d8d52f4d97b61d861586e5a008c18d15e39d

diff --git a/loleaflet/src/layer/AnnotationManager.js 
b/loleaflet/src/layer/AnnotationManager.js
index c882b9a0..ba539491 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -129,6 +129,7 @@ L.AnnotationManager = L.Class.extend({
                if (this._selected.annotation) {
                        point = L.point(topRight.x, 
this._map._docLayer._twipsToPixels(this._selected.annotation._data.anchorPos.min).y);
                        
this._selected.annotation.setLatLng(this._map.unproject(point));
+                       this._selected.annotation.show();
                        bounds = this._selected.annotation.getBounds();
                        bounds.extend(bounds.min.subtract([0, 
this.options.marginY]));
                        bounds.extend(bounds.getBottomLeft().add([0, 
this.options.marginY]));
@@ -143,6 +144,7 @@ L.AnnotationManager = L.Class.extend({
                        point = L.point(topRight.x, 
this._map._docLayer._twipsToPixels(annotation._data.anchorPos.min).y);
                        latlng = this._map.unproject(point);
                        annotation.setLatLng(latlng);
+                       annotation.show();
                        bounds = annotation.getBounds();
                        foundBounds = null;
                        for (var itBounds in layouts) {
@@ -180,7 +182,6 @@ L.AnnotationManager = L.Class.extend({
                        }
 
                        annotation.setLatLng(latlng);
-                       annotation.show();
                }
        },
 
diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js 
b/loleaflet/src/layer/tile/ImpressTileLayer.js
index 1390216e..552e4ddf 100644
--- a/loleaflet/src/layer/tile/ImpressTileLayer.js
+++ b/loleaflet/src/layer/tile/ImpressTileLayer.js
@@ -126,9 +126,9 @@ L.ImpressTileLayer = L.TileLayer.extend({
                        annotation = annotations[index];
                        if (index >= this._topAnnotation) {
                                annotation.setLatLng(bounds ? 
this._map.layerPointToLatLng(bounds.getBottomLeft()) : 
this._map.layerPointToLatLng(topRight));
+                               annotation.show();
                                bounds = annotation.getBounds();
                                bounds.extend(L.point(bounds.max.x, 
bounds.max.y + this.options.marginY));
-                               annotation.show();
                        } else {
                                annotation.hide();
                        }
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to