[Libreoffice-commits] online.git: loleaflet/src
Pranav Kant
pranavk at collabora.co.uk
Thu Mar 23 11:11:24 UTC 2017
loleaflet/src/layer/AnnotationManager.js | 3 +--
loleaflet/src/layer/tile/ImpressTileLayer.js | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
New commits:
commit b0b7e5abe307baa05efd4e8bcbc2f3d846dd4190
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Thu Mar 23 16:39:01 2017 +0530
Revert "loleaflet: ensure visible element before getting bounds"
This reverts commit a759a01c7de89b387943ad4173c9b72cd30581d9.
diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js
index ba539491..c882b9a0 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -129,7 +129,6 @@ 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]));
@@ -144,7 +143,6 @@ 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) {
@@ -182,6 +180,7 @@ 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 552e4ddf..1390216e 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();
}
More information about the Libreoffice-commits
mailing list