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

Henry Castro hcastro at collabora.com
Wed Sep 21 19:24:46 UTC 2016


 loleaflet/src/layer/marker/Cursor.js  |    6 +++---
 loleaflet/src/layer/tile/TileLayer.js |   17 ++++++++++-------
 2 files changed, 13 insertions(+), 10 deletions(-)

New commits:
commit a8394110f26170accf1385632f41a3ab8ca179be
Author: Henry Castro <hcastro at collabora.com>
Date:   Wed Sep 21 15:23:58 2016 -0400

    loleaflet: blink cursor should en top of rendering stack

diff --git a/loleaflet/src/layer/marker/Cursor.js b/loleaflet/src/layer/marker/Cursor.js
index 7fade22..78706e0 100644
--- a/loleaflet/src/layer/marker/Cursor.js
+++ b/loleaflet/src/layer/marker/Cursor.js
@@ -5,7 +5,8 @@
 L.Cursor = L.Layer.extend({
 
 	options: {
-		opacity: 1
+		opacity: 1,
+		zIndex: 1000
 	},
 
 	initialize: function (latlng, size, options) {
@@ -84,8 +85,7 @@ L.Cursor = L.Layer.extend({
 
 	_setPos: function (pos) {
 		L.DomUtil.setPosition(this._container, pos);
-
-		this._zIndex = pos.y + this.options.zIndexOffset;
+		this._container.style.zIndex = this.options.zIndex;
 	},
 
 	setOpacity: function (opacity) {
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 1c2f2cc..7cd46b6 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1170,10 +1170,12 @@ L.TileLayer = L.GridLayer.extend({
 		if (this._map._permission === 'edit' && this._isCursorVisible && this._isCursorOverlayVisible
 				&& !this._isEmptyRectangle(this._visibleCursor)) {
 			if (!this._cursorMarker) {
-				this._cursorMarker = L.cursor(null, null, {blink: true});
+				this._cursorMarker = L.cursor(cursorPos, pixBounds.getSize().multiplyBy(this._map.getZoomScale(this._map.getZoom())),
+					{blink: true});
+			}
+			else {
+				this._cursorMarker.setLatLng(cursorPos, pixBounds.getSize().multiplyBy(this._map.getZoomScale(this._map.getZoom())));
 			}
-
-			this._cursorMarker.setLatLng(cursorPos, pixBounds.getSize().multiplyBy(this._map.getZoomScale(this._map.getZoom())));
 			this._map.addLayer(this._cursorMarker);
 		}
 		else if (this._cursorMarker) {
@@ -1204,14 +1206,15 @@ L.TileLayer = L.GridLayer.extend({
 					blink: false,
 					header: true, // we want a 'hat' to our view cursors (which will contain view user names)
 					headerTimeout: 3000, // hide after some interval
+					zIndex: viewId,
 					headerName: this._map.getViewName(viewId)
 				};
-
-				viewCursorMarker = L.cursor(null, null, viewCursorOptions);
+				viewCursorMarker = L.cursor(viewCursorPos, pixBounds.getSize().multiplyBy(this._map.getZoomScale(this._map.getZoom())), viewCursorOptions);
 				this._viewCursors[viewId].marker = viewCursorMarker;
 			}
-
-			viewCursorMarker.setLatLng(viewCursorPos, pixBounds.getSize().multiplyBy(this._map.getZoomScale(this._map.getZoom())));
+			else {
+				viewCursorMarker.setLatLng(viewCursorPos, pixBounds.getSize().multiplyBy(this._map.getZoomScale(this._map.getZoom())));
+			}
 			this._map.addLayer(viewCursorMarker);
 		}
 		else if (viewCursorMarker) {


More information about the Libreoffice-commits mailing list