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

Pranam Lashkari (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 9 12:19:08 UTC 2020


 loleaflet/src/layer/AnnotationManagerImpress.js |    4 +++-
 loleaflet/src/map/Map.js                        |   10 ++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit a70ff81ee998a6e5b79cdd8fe7a4b62eb30b75ac
Author:     Pranam Lashkari <lpranam at collabora.com>
AuthorDate: Tue Sep 8 06:30:46 2020 +0530
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Sep 9 14:18:49 2020 +0200

    leaflet: fixed annotation getting out of screen
    
    problem:
    annotations in impress were overlapped by controls sometimes
    which makes kabab menu inaccessible
    on the reloading or opening doc if annotation,
    half annotation is out of the screen on right
    
    Change-Id: I830df8a393dae93db571fb999cb649bc87126d4a
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102212
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Tested-by: Jenkins
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/loleaflet/src/layer/AnnotationManagerImpress.js b/loleaflet/src/layer/AnnotationManagerImpress.js
index ef92c665f..2e5945a9c 100644
--- a/loleaflet/src/layer/AnnotationManagerImpress.js
+++ b/loleaflet/src/layer/AnnotationManagerImpress.js
@@ -252,7 +252,9 @@ L.AnnotationManagerImpress = L.AnnotationManagerBase.extend({
 	layoutAnnotations: function () {
 		var topAnnotation;
 		var annotations = this._annotations[this.getSelectedPartHash()];
-		var diffPoint = L.point((this._selectedAnnotation ? 3 : 2) * this.options.marginX, this.options.marginY);
+
+		// Keeping annotations close to slide to avoide being overlapped by controls
+		var diffPoint = L.point(5, this.options.marginY);
 		var topRight = this._map.latLngToLayerPoint(this._map.options.docBounds.getNorthEast()).add(diffPoint);
 		var bounds = null;
 		for (var index in annotations) {
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 9f3633929..b774debf9 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -1159,6 +1159,16 @@ L.Map = L.Evented.extend({
 		}
 
 		this.fire('moveend', {hard: !preserveMapOffset});
+
+		if (this.getDocType() === 'presentation') {
+			if (this._docLayer._annotationManager.getSelectedPart() !== undefined) {
+				var parHash = this._docLayer._annotationManager.getSelectedPartHash();
+				var annotations = this._docLayer._annotationManager._annotations[parHash];
+				for (var i in annotations) {
+					annotations[i].update();
+				}
+			}
+		}
 	},
 
 	_rawPanBy: function (offset) {


More information about the Libreoffice-commits mailing list