[Libreoffice-commits] online.git: Branch 'distro/collabora/milestone-7' - loleaflet/src

Jan Holesovsky kendy at collabora.com
Mon Feb 8 20:03:20 UTC 2016


 loleaflet/src/layer/tile/TileLayer.js |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 362c9ae3a24e55ad706db4a3116ce45b424efce1
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Mon Feb 8 21:02:32 2016 +0100

    loleaflet: Trigger the clientvisiblearea message even when resizing.

diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 800371f..f74e234 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -124,8 +124,9 @@ L.TileLayer = L.GridLayer.extend({
 			'tilepixelheight=' + this.options.tileSize + ' ' +
 			'tiletwipwidth=' + this.options.tileWidthTwips + ' ' +
 			'tiletwipheight=' + this.options.tileHeightTwips;
+
 		// Mark visible area as dirty by default.
-		this._clientVisibleArea = true;
+		this._invalidateClientVisibleArea();
 	},
 
     onAdd: function (map) {
@@ -158,6 +159,7 @@ L.TileLayer = L.GridLayer.extend({
 			map.on('zoomend', this._onCellCursorShift, this);
 		}
 		map.on('zoomend', this._updateClientZoom, this);
+		map.on('resize zoomend', this._invalidateClientVisibleArea, this);
 		map.on('dragstart', this._onDragStart, this);
 		map.on('requestloksession', this._onRequestLOKSession, this);
 		map.on('error', this._mapOnError, this);
@@ -780,7 +782,7 @@ L.TileLayer = L.GridLayer.extend({
 			var payload = 'clientvisiblearea x=' + Math.round(pos.x) + ' y=' + Math.round(pos.y) +
 				' width=' + Math.round(size.x) + ' height=' + Math.round(size.y);
 			this._map._socket.sendMessage(payload);
-			this._clientVisibleArea = null;
+			this._clientVisibleArea = false;
 		}
 		this._map._socket.sendMessage('key type=' + type +
 				' char=' + charcode + ' key=' + keycode);
@@ -1261,7 +1263,9 @@ L.TileLayer = L.GridLayer.extend({
 			'tilepixelheight=' + this._tileSize + ' ' +
 			'tiletwipwidth=' + this._tileWidthTwips + ' ' +
 			'tiletwipheight=' + this._tileHeightTwips;
-		// Zoom changed, mark visible area as dirty.
+	},
+
+	_invalidateClientVisibleArea: function() {
 		this._clientVisibleArea = true;
 	}
 });


More information about the Libreoffice-commits mailing list