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

Henry Castro hcastro at collabora.com
Thu Mar 23 01:19:19 UTC 2017


 loleaflet/src/layer/AnnotationManager.js |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f3700400e68a7e33c45b1a2d483d6fff53a1f920
Author: Henry Castro <hcastro at collabora.com>
Date:   Wed Mar 22 21:21:41 2017 -0400

    loleaflet: fix the selection of the annotation object
    
    Change-Id: I1bf6b669b768057b7b9943654db79b2966ca3ec3

diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js
index 8933f6e5..c882b9a0 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -94,7 +94,7 @@ L.AnnotationManager = L.Class.extend({
 
 	select: function (obj) {
 		var annotation = obj instanceof L.Annotation ? obj : this.getItem(obj);
-		if (!this._selected.annotation || this._selected.annotation._data.id !== annotation._data.id) {
+		if (annotation) {
 			this._selected.annotation = annotation;
 			this.update();
 		}
@@ -103,8 +103,8 @@ L.AnnotationManager = L.Class.extend({
 	update: function () {
 		var topRight = this._map.project(this._map.options.maxBounds.getNorthEast());
 		var point, rectangles;
-		this.layout();
 		if (this._selected.annotation) {
+			this.layout();
 			point = this._map._docLayer._twipsToPixels(this._selected.annotation._data.anchorPos.min);
 			this._map._docLayer._selections.clearLayers();
 			rectangles = L.PolyUtil.rectanglesToPolygons(L.LOUtil.stringToRectangles(this._selected.annotation._data.textRange), this._map._docLayer);


More information about the Libreoffice-commits mailing list