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

Andras Timar andras.timar at collabora.com
Thu May 12 11:33:55 UTC 2016


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

New commits:
commit 02ae68dbe53449e161778bfac96e937d966430da
Author: Andras Timar <andras.timar at collabora.com>
Date:   Thu May 12 13:29:28 2016 +0200

    bccu#1712 Math.sign is not defined in IE 11
    
    (cherry picked from commit 295163422efd04d787ea3df6952c95c2264ca63c)

diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 839e2c7..dff6449 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -467,9 +467,10 @@ L.TileLayer = L.GridLayer.extend({
 
 		var horizontalDirection = 0,
 			verticalDirection = 0;
+		var sign = function(x) {return x>0?1:x<0?-1:x;}
 		if (!this._isEmptyRectangle(this._prevCellCursor) && !this._isEmptyRectangle(this._cellCursor)) {
-			horizontalDirection = Math.sign(this._cellCursor.getWest() - this._prevCellCursor.getWest());
-			verticalDirection = Math.sign(this._cellCursor.getNorth() - this._prevCellCursor.getNorth());
+			horizontalDirection = sign(this._cellCursor.getWest() - this._prevCellCursor.getWest());
+			verticalDirection = sign(this._cellCursor.getNorth() - this._prevCellCursor.getNorth());
 		}
 
 		if (!this._isEmptyRectangle(this._cellCursor) && !this._prevCellCursor.equals(this._cellCursor)) {


More information about the Libreoffice-commits mailing list