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

Pranav Kant pranavk at collabora.co.uk
Wed Dec 7 15:31:56 UTC 2016


 loleaflet/src/layer/tile/CalcTileLayer.js    |    4 ++--
 loleaflet/src/layer/tile/GridLayer.js        |   12 ++++++------
 loleaflet/src/layer/tile/ImpressTileLayer.js |    4 ++--
 loleaflet/src/layer/tile/TileLayer.js        |   21 ++++++++++++---------
 loleaflet/src/layer/tile/WriterTileLayer.js  |    4 ++--
 loleaflet/src/map/Map.js                     |    2 +-
 6 files changed, 25 insertions(+), 22 deletions(-)

New commits:
commit fbb26d0d137ae8020328d4ba3b5350c8e681acc7
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Wed Dec 7 20:54:26 2016 +0530

    loleaflet: Request higher pixel density tiles on retina display
    
    Change-Id: I418f0db47239c915d8f12c07979306a814370b65

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js
index b66a657..5d6e6e4 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -83,8 +83,8 @@ L.CalcTileLayer = L.TileLayer.extend({
 		{
 			var message = 'tilecombine ' +
 				'part=' + command.part + ' ' +
-				'width=' + this._tileSize + ' ' +
-				'height=' + this._tileSize + ' ' +
+				'width=' + this._tileWidthPx + ' ' +
+				'height=' + this._tileHeightPx + ' ' +
 				'tileposx=' + tilePositionsX + ' ' +
 				'tileposy=' + tilePositionsY + ' ' +
 				'tilewidth=' + this._tileWidthTwips + ' ' +
diff --git a/loleaflet/src/layer/tile/GridLayer.js b/loleaflet/src/layer/tile/GridLayer.js
index a704b42..9f675d1 100644
--- a/loleaflet/src/layer/tile/GridLayer.js
+++ b/loleaflet/src/layer/tile/GridLayer.js
@@ -684,8 +684,8 @@ L.GridLayer = L.Layer.extend({
 			if (tilePositionsX !== '' && tilePositionsY !== '') {
 				var message = 'tilecombine ' +
 					'part=' + this._selectedPart + ' ' +
-					'width=' + this._tileSize + ' ' +
-					'height=' + this._tileSize + ' ' +
+					'width=' + this._tileWidthPx + ' ' +
+					'height=' + this._tileHeightPx + ' ' +
 					'tileposx=' + tilePositionsX + ' ' +
 					'tileposy=' + tilePositionsY + ' ' +
 					'tilewidth=' + this._tileWidthTwips + ' ' +
@@ -916,8 +916,8 @@ L.GridLayer = L.Layer.extend({
 				twips = this._coordsToTwips(coords);
 				msg = 'tile ' +
 					'part=' + coords.part + ' ' +
-					'width=' + this._tileSize + ' ' +
-					'height=' + this._tileSize + ' ' +
+					'width=' + this._tileWidthPx + ' ' +
+					'height=' + this._tileHeightPx + ' ' +
 					'tileposx=' + twips.x + ' '	+
 					'tileposy=' + twips.y + ' ' +
 					'tilewidth=' + this._tileWidthTwips + ' ' +
@@ -946,8 +946,8 @@ L.GridLayer = L.Layer.extend({
 				twips = this._coordsToTwips(coords);
 				msg = 'tilecombine ' +
 					'part=' + coords.part + ' ' +
-					'width=' + this._tileSize + ' ' +
-					'height=' + this._tileSize + ' ' +
+					'width=' + this._tileWidthPx + ' ' +
+					'height=' + this._tileHeightPx + ' ' +
 					'tileposx=' + tilePositionsX + ' '	+
 					'tileposy=' + tilePositionsY + ' ' +
 					'tilewidth=' + this._tileWidthTwips + ' ' +
diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js
index 07bb75c..da0166c 100644
--- a/loleaflet/src/layer/tile/ImpressTileLayer.js
+++ b/loleaflet/src/layer/tile/ImpressTileLayer.js
@@ -67,8 +67,8 @@ L.ImpressTileLayer = L.TileLayer.extend({
 		{
 			var message = 'tilecombine ' +
 				'part=' + command.part + ' ' +
-				'width=' + this._tileSize + ' ' +
-				'height=' + this._tileSize + ' ' +
+				'width=' + this._tileWidthPx + ' ' +
+				'height=' + this._tileHeightPx + ' ' +
 				'tileposx=' + tilePositionsX + ' ' +
 				'tileposy=' + tilePositionsY + ' ' +
 				'tilewidth=' + this._tileWidthTwips + ' ' +
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 52658e7..e06c68b 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -56,10 +56,13 @@ L.TileLayer = L.GridLayer.extend({
 
 		options = L.setOptions(this, options);
 
-		// detecting retina displays, adjusting tileSize and zoom levels
-		if (options.detectRetina && L.Browser.retina && options.maxZoom > 0) {
+		this._tileWidthPx = options.tileSize;
+		this._tileHeightPx = options.tileSize;
 
-			options.tileSize = Math.floor(options.tileSize / 2);
+		// detecting retina displays, adjusting tileWidthPx, tileHeightPx and zoom levels
+		if (options.detectRetina && L.Browser.retina && options.maxZoom > 0) {
+			this._tileWidthPx *= 2;
+			this._tileHeightPx *= 2;
 			options.zoomOffset++;
 
 			options.minZoom = Math.max(0, options.minZoom);
@@ -133,8 +136,8 @@ L.TileLayer = L.GridLayer.extend({
 		this._previewInvalidations = [];
 		this._partPageRectanglesTwips = [];
 		this._partPageRectanglesPixels = [];
-		this._clientZoom = 'tilepixelwidth=' + this.options.tileSize + ' ' +
-			'tilepixelheight=' + this.options.tileSize + ' ' +
+		this._clientZoom = 'tilepixelwidth=' + this._tileWidthPx + ' ' +
+			'tilepixelheight=' + this._tileHeightPx + ' ' +
 			'tiletwipwidth=' + this.options.tileWidthTwips + ' ' +
 			'tiletwipheight=' + this.options.tileHeightTwips;
 
@@ -1849,8 +1852,8 @@ L.TileLayer = L.GridLayer.extend({
 	_onCellCursorShift: function (force) {
 		if (this._cellCursorMarker || force) {
 			this._map._socket.sendMessage('commandvalues command=.uno:CellCursor'
-			                     + '?outputHeight=' + this._tileSize
-			                     + '&outputWidth=' + this._tileSize
+			                     + '?outputHeight=' + this._tileWidthPx
+			                     + '&outputWidth=' + this._tileHeightPx
 			                     + '&tileHeight=' + this._tileWidthTwips
 			                     + '&tileWidth=' + this._tileHeightTwips);
 		}
@@ -1922,8 +1925,8 @@ L.TileLayer = L.GridLayer.extend({
 	},
 
 	_updateClientZoom: function () {
-		this._clientZoom = 'tilepixelwidth=' + this._tileSize + ' ' +
-			'tilepixelheight=' + this._tileSize + ' ' +
+		this._clientZoom = 'tilepixelwidth=' + this._tileWidthPx + ' ' +
+			'tilepixelheight=' + this._tileHeightPx + ' ' +
 			'tiletwipwidth=' + this._tileWidthTwips + ' ' +
 			'tiletwipheight=' + this._tileHeightTwips;
 	},
diff --git a/loleaflet/src/layer/tile/WriterTileLayer.js b/loleaflet/src/layer/tile/WriterTileLayer.js
index 7b93b23..9402f6c 100644
--- a/loleaflet/src/layer/tile/WriterTileLayer.js
+++ b/loleaflet/src/layer/tile/WriterTileLayer.js
@@ -69,8 +69,8 @@ L.WriterTileLayer = L.TileLayer.extend({
 			// always 0 anyway
 			var message = 'tilecombine ' +
 				'part=' + command.part + ' ' +
-				'width=' + this._tileSize + ' ' +
-				'height=' + this._tileSize + ' ' +
+				'width=' + this._tileWidthPx + ' ' +
+				'height=' + this._tileHeightPx + ' ' +
 				'tileposx=' + tilePositionsX + ' ' +
 				'tileposy=' + tilePositionsY + ' ' +
 				'tilewidth=' + this._tileWidthTwips + ' ' +
commit 8ee3a8d6c2677fa985c7c28446c243dfdaf6397c
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Wed Dec 7 18:03:50 2016 +0530

    loleaflet: Popup virtual keyboard only in editmode
    
    Change-Id: I5e1e134e07f65bc52ff3c5f38879ad3b7097254c

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 982664f..682f246 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -901,7 +901,7 @@ L.Map = L.Evented.extend({
 		// For touch devices, to pop-up the keyboard, it is required to call
 		// .focus() method on hidden input within actual 'click' event here
 		// Calling from some other place with no real 'click' event doesn't work
-		if (type === 'click') {
+		if (type === 'click' && this._permission === 'edit') {
 			this._textArea.blur();
 			this._textArea.focus();
 		}


More information about the Libreoffice-commits mailing list