loleaflet: mobile: avoid cursors/handlers aren't made visible after zoom

So in same case pinch event is triggered even on a single tap. In that
cases the _onPinchEnd animation fails causing to not change
cursors/handlers opacity back to 1, for that reason I pushed a patch
which move the animation stuff to the end of _onPinchEnd and moreover
I even check that the center parameter is really defined.

Change-Id: I1f1c98fb3ad056aa14ee5657e2f5f1cf489789eb
This commit is contained in:
Marco Cecchetti 2019-10-19 16:58:18 +02:00
parent 5800eaa66e
commit 8913d1bf2c

View file

@ -416,8 +416,6 @@ 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);
if (this._map._docLayer.isCursorVisible()) {
this._map._docLayer._cursorMarker.setOpacity(1);
}
@ -430,6 +428,11 @@ L.Map.TouchGesture = L.Handler.extend({
if (this._map._docLayer._selectionHandles['end']) {
this._map._docLayer._selectionHandles['end'].setOpacity(1);
}
if (this._center) {
L.Util.cancelAnimFrame(this._animRequest);
this._map._animateZoom(this._center, finalZoom, true, true);
}
}
},