[Libreoffice-commits] online.git: loleaflet/src
Aditya Dewan
iit2015097 at iiita.ac.in
Thu May 18 09:41:53 UTC 2017
loleaflet/src/layer/tile/TileLayer.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 45b923cb2eedaee3430d6d1f34d5ce7157dd0b36
Author: Aditya Dewan <iit2015097 at iiita.ac.in>
Date: Thu May 18 14:12:42 2017 +0530
tdf#107891 zoom does not reset on window resize
Change-Id: I799d2517496233e6ec04587c257eeada56769aca
Reviewed-on: https://gerrit.libreoffice.org/37747
Reviewed-by: pranavk <pranavk at collabora.co.uk>
Tested-by: pranavk <pranavk at collabora.co.uk>
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 8611d3d6..109569ce 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1834,7 +1834,7 @@ L.TileLayer = L.GridLayer.extend({
_fitWidthZoom: function (e, maxZoom) {
var size = e ? e.newSize : this._map.getSize();
var widthTwips = size.x * this._map.options.tileWidthTwips / this._tileSize;
- maxZoom = maxZoom ? maxZoom : this._map.options.zoom;
+ maxZoom = maxZoom ? maxZoom : this._map.getZoom();
// 'fit width zoom' has no use in spreadsheets, ignore it there
if (this._docType !== 'spreadsheet') {
@@ -1842,7 +1842,7 @@ L.TileLayer = L.GridLayer.extend({
if (this._docWidthTwips > 0)
{
var ratio = widthTwips / this._docWidthTwips;
- var zoom = this._map.options.zoom + Math.floor(Math.log(ratio) / Math.log(crsScale));
+ var zoom = this._map.getZoom() + Math.floor(Math.log(ratio) / Math.log(crsScale));
zoom = Math.max(1, zoom);
zoom = Math.min(maxZoom, zoom);
More information about the Libreoffice-commits
mailing list