[Libreoffice-commits] online.git: loleaflet/src
Henry Castro (via logerrit)
logerrit at kemper.freedesktop.org
Tue Aug 20 14:37:14 UTC 2019
loleaflet/src/map/handler/Map.TouchGesture.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
New commits:
commit e8e1516df128b489e421b196335a24d8c152200b
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Sat Jun 29 10:07:48 2019 -0400
Commit: Henry Castro <hcastro at collabora.com>
CommitDate: Tue Aug 20 16:36:54 2019 +0200
loleaflet: fix flickering when zoom in and out
Change-Id: Ib39e5fc8df06ec420f0c3ee78ce6616bb4eafda8
Reviewed-on: https://gerrit.libreoffice.org/77833
Reviewed-by: Henry Castro <hcastro at collabora.com>
Tested-by: Henry Castro <hcastro at collabora.com>
diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js
index e5d954f5f..cc81fc319 100644
--- a/loleaflet/src/map/handler/Map.TouchGesture.js
+++ b/loleaflet/src/map/handler/Map.TouchGesture.js
@@ -323,7 +323,11 @@ L.Map.TouchGesture = L.Handler.extend({
if (this._map.getDocType() !== 'spreadsheet') {
this._center = this._map.mouseEventToLatLng({clientX: e.center.x, clientY: e.center.y});
this._zoom = this._map.getScaleZoom(e.scale);
- this._map._animateZoom(this._center, this._zoom, false, true);
+
+ L.Util.cancelAnimFrame(this._animRequest);
+ this._animRequest = L.Util.requestAnimFrame(function () {
+ this._map._animateZoom(this._center, this._zoom, false, true);
+ }, this, true, this._map._container);
}
},
@@ -333,6 +337,7 @@ L.Map.TouchGesture = L.Handler.extend({
zoomDelta = this._zoom - oldZoom,
finalZoom = this._map._limitZoom(zoomDelta > 0 ? Math.ceil(this._zoom) : Math.floor(this._zoom));
+ L.Util.cancelAnimFrame(this._animRequest);
this._map._animateZoom(this._center, finalZoom, true, true);
}
},
More information about the Libreoffice-commits
mailing list