Enable desktop zoom-animation for non-Calc apps
Signed-off-by: Dennis Francis <dennis.francis@collabora.com> Change-Id: I2ebee4c53ab60e8c6cf61e392f5e0685110abb8b (cherry picked from commit 199af73b6ddb78f6ea3ce12c4e8dc4bb42b6ee37)
This commit is contained in:
parent
76e7c501d9
commit
449d076988
1 changed files with 14 additions and 6 deletions
|
@ -538,7 +538,7 @@ L.Map = L.Evented.extend({
|
|||
|
||||
newTopLeftPx._add(new L.Point(diffX, diffY));
|
||||
topLeftPx._add(new L.Point(diffX / zoomScaleAbs, diffY / zoomScaleAbs));
|
||||
// FIXME: move to topLeftPx ?
|
||||
// FIXME: pan to topLeftPx before the animation ?
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -562,7 +562,6 @@ L.Map = L.Evented.extend({
|
|||
calcLayer.activateCursor();
|
||||
}
|
||||
});
|
||||
//this._resetView(L.latLng(newCenterLatLng), this._limitZoom(zoom));
|
||||
},
|
||||
|
||||
ignoreCursorUpdate: function () {
|
||||
|
@ -626,12 +625,21 @@ L.Map = L.Evented.extend({
|
|||
var caretPos = this._docLayer._visibleCursor.getCenter();
|
||||
var newCenter = new L.LatLng(curCenter.lat + (caretPos.lat - curCenter.lat) * (1.0 - zoomScale),
|
||||
curCenter.lng + (caretPos.lng - curCenter.lng) * (1.0 - zoomScale));
|
||||
var retValue = this.setView(newCenter, zoom, {zoom: options});
|
||||
this._docLayer.setZoomChanged(false);
|
||||
return retValue;
|
||||
var thisObj = this;
|
||||
this._docLayer.runZoomAnimation(zoom, caretPos /* pinchCenter */,
|
||||
// mapUpdater
|
||||
function() {
|
||||
thisObj.setView(newCenter, zoom, {zoom: options});
|
||||
},
|
||||
// runAtFinish
|
||||
function() {
|
||||
thisObj._docLayer.setZoomChanged(false);
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
retValue = this.setView(curCenter, zoom, {zoom: options});
|
||||
var retValue = this.setView(curCenter, zoom, {zoom: options});
|
||||
this._docLayer.setZoomChanged(false);
|
||||
return retValue;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue