From 152ad884e26e030ffa364bfc6ef07e48dad1329b Mon Sep 17 00:00:00 2001 From: Mihai Varga Date: Fri, 11 Dec 2015 14:50:07 +0200 Subject: [PATCH] Revert "loleaflet: Change !(... >= 0) to ... < 0 for readability." This reverts commit 00d7ab35195b437c54cc9359dac8f830f5b98471. _currentPage can also be undefined so in that case !(this._currentPage >= 0) will be evaluated to true while this._currentPage < 0 will be false (as it should be) --- loleaflet/src/layer/tile/TileLayer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 30afa3ee8..d68df14c5 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -949,7 +949,7 @@ L.TileLayer = L.GridLayer.extend({ _onCurrentPageUpdate: function () { var mapCenter = this._map.project(this._map.getCenter()); - if (!this._partPageRectanglesPixels || this._currentPage < 0 || this._currentPage >= this._partPageRectanglesPixels.length || + if (!this._partPageRectanglesPixels || !(this._currentPage >= 0) || this._currentPage >= this._partPageRectanglesPixels.length || this._partPageRectanglesPixels[this._currentPage].contains(mapCenter)) { // page number has not changed return;