summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAditya Dewan <iit2015097@iiita.ac.in>2017-05-18 14:12:42 +0530
committerpranavk <pranavk@collabora.co.uk>2017-05-18 11:41:34 +0200
commit45b923cb2eedaee3430d6d1f34d5ce7157dd0b36 (patch)
tree85376c5be528e2e2e05117f94c6eb695b736bd40
parent827d3f63cb5b68b186bf76755eda05ea18f9491a (diff)
tdf#107891 zoom does not reset on window resizelibreoffice-5-4-branch-point
Change-Id: I799d2517496233e6ec04587c257eeada56769aca Reviewed-on: https://gerrit.libreoffice.org/37747 Reviewed-by: pranavk <pranavk@collabora.co.uk> Tested-by: pranavk <pranavk@collabora.co.uk>
-rw-r--r--loleaflet/src/layer/tile/TileLayer.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 8611d3d6c..109569ce5 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);