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

Mihai Varga mihai.varga at collabora.com
Mon Jul 27 02:35:12 PDT 2015


 loleaflet/src/layer/tile/GridLayer.js |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

New commits:
commit 8d2afb39df09d5f71b8a1b146bf6c76559e1f1ac
Author: Mihai Varga <mihai.varga at collabora.com>
Date:   Mon Jul 27 12:34:11 2015 +0300

    loleaflet: update max bounds when the document has a new size

diff --git a/loleaflet/src/layer/tile/GridLayer.js b/loleaflet/src/layer/tile/GridLayer.js
index 7b4f7b6..b8c5e53 100644
--- a/loleaflet/src/layer/tile/GridLayer.js
+++ b/loleaflet/src/layer/tile/GridLayer.js
@@ -369,15 +369,10 @@ L.GridLayer = L.Layer.extend({
 		var bottomRight = new L.Point(docPixelLimits.x, docPixelLimits.y);
 		bottomRight = this._map.unproject(bottomRight);
 
-		if (this._documentInfo === '') {
+		if (this._documentInfo === '' || sizeChanged) {
 			// we just got the first status so we need to center the document
 			this._map.setMaxBounds(new L.LatLngBounds(topLeft, bottomRight));
 		}
-		else if (sizeChanged) {
-			// we just update the bounds without panning into the new bounds,
-			// the scrollbars should handle that
-			this._map.options.maxBounds = new L.LatLngBounds(topLeft, bottomRight);
-		}
 
 		var scrollPixelLimits = new L.Point(this._docWidthTwips / this._tileWidthTwips,
 										 this._docHeightTwips / this._tileHeightTwips);


More information about the Libreoffice-commits mailing list