loleaflet/src/map/Map.js | 15 --------------- 1 file changed, 15 deletions(-)
New commits: commit 3c60cbfd39bb3ede2f2efddf870c292ab6c0dc4d Author: Jan Holesovsky <[email protected]> AuthorDate: Wed Aug 26 15:15:55 2020 +0200 Commit: Jan Holesovsky <[email protected]> CommitDate: Wed Aug 26 15:15:55 2020 +0200 calc canvas: Keep the document zoom separate from the browser zoom. With this, if you increase or decrease the browser zoom, the document zoom still stays the same. Before this, when you had eg. 100% document zoom and 150% browser zoom and try to zoom out, it actually zooms in instead, because the browser's zoom is added to the mix; and it displays the wrong value in the dropdown. Even worse, to get the 100% again, you have to choose 80% so that the correction for the browser zoom is added, resulting in the 100%. We should keep both the document and browser zoom separately. The questions is then whether to combine them later for the actual document rendering; I believe we should not, but even if we should, we cannot do it directly in the setZoom() method, but instead closer to the painting itself. Change-Id: Ib7f3d2ae8b4e6e6086f14e933b215c32326c6be6 diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index 8c3271b95..84a286eb6 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -461,19 +461,6 @@ L.Map = L.Evented.extend({ return Math.round(relzoom) + this.options.zoom; }, - // Compute the nearest zoom level corresponding to the effective zoom-scale (ie, with dpiscale included). - findNearestProductZoom: function (zoom) { - var clientZoomScale = this.zoomToFactor(zoom); - - var dpiScale = this._docLayer ? this._docLayer.canvasDPIScale() : L.getDpiScaleFactor(true /* useExactDPR */); - - var zoomScale = clientZoomScale * dpiScale; - var nearestZoom = this.factorToZoom(zoomScale); - nearestZoom = this._limitZoom(nearestZoom); - - return nearestZoom; - }, - setZoom: function (zoom, options) { if (this._docLayer instanceof L.CanvasTileLayer) { @@ -481,8 +468,6 @@ L.Map = L.Evented.extend({ zoom = this._clientZoom || this.options.zoom; else this._clientZoom = zoom; - - zoom = this.findNearestProductZoom(zoom); } if (!this._loaded) { _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
