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

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Mon Dec 9 16:00:05 UTC 2019


 loleaflet/src/layer/AnnotationManager.js |    2 +-
 loleaflet/src/map/Map.js                 |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 21e4a62e3258b62f8ba5adf04984fffd41e98819
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Mon Dec 9 15:58:46 2019 +0000
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Mon Dec 9 15:59:45 2019 +0000

    zoom: while we are in a zoom animation use the target zoom, follow-on.
    
    addresses more cases missed by 9afbe35d0d30bbb20d1c2ed62af026d692301194
    which affect selection rectangles among other items.
    
    Change-Id: Ib4d93f765eb39f7acaa8bbf19a21a910b03e4bb3

diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js
index 0a7c7a07b..35bb428b2 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -908,7 +908,7 @@ L.AnnotationManager = L.Class.extend({
 	},
 
 	_getScaleFactor: function () {
-		var scaleFactor = 1.0 / this._map.getZoomScale(this._map.options.zoom, this._map._zoom);
+		var scaleFactor = 1.0 / this._map.getZoomScale(this._map.options.zoom, this._map.getZoom());
 		if (scaleFactor < 0.4)
 			scaleFactor = 0.4;
 		else if (scaleFactor < 0.6)
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 908e1f1fc..1a26c4b2e 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -829,12 +829,12 @@ L.Map = L.Evented.extend({
 
 	getZoomScale: function (toZoom, fromZoom) {
 		var crs = this.options.crs;
-		fromZoom = fromZoom === undefined ? this._zoom : fromZoom;
+		fromZoom = fromZoom === undefined ? this.getZoom() : fromZoom;
 		return crs.scale(toZoom) / crs.scale(fromZoom);
 	},
 
 	getScaleZoom: function (scale, fromZoom) {
-		fromZoom = fromZoom === undefined ? this._zoom : fromZoom;
+		fromZoom = fromZoom === undefined ? this.getZoom() : fromZoom;
 		return fromZoom + (Math.log(scale) / Math.log(1.2));
 	},
 
@@ -842,13 +842,13 @@ L.Map = L.Evented.extend({
 	// conversion methods
 
 	project: function (latlng, zoom) { // (LatLng[, Number]) -> Point
-		zoom = zoom === undefined ? this._zoom : zoom;
+		zoom = zoom === undefined ? this.getZoom() : zoom;
 		var projectedPoint = this.options.crs.latLngToPoint(L.latLng(latlng), zoom);
 		return new L.Point(L.round(projectedPoint.x, 1e-6), L.round(projectedPoint.y, 1e-6));
 	},
 
 	unproject: function (point, zoom) { // (Point[, Number]) -> LatLng
-		zoom = zoom === undefined ? this._zoom : zoom;
+		zoom = zoom === undefined ? this.getZoom() : zoom;
 		return this.options.crs.pointToLatLng(L.point(point), zoom);
 	},
 


More information about the Libreoffice-commits mailing list