loleaflet: mobile: limit the center point with max bounds when zooming
Change-Id: Ic2a3823204a717cb17057f5d8b4e25efea2c7759 Reviewed-on: https://gerrit.libreoffice.org/77847 Reviewed-by: Henry Castro <hcastro@collabora.com> Tested-by: Henry Castro <hcastro@collabora.com>
This commit is contained in:
parent
93992872e1
commit
2ba4becb75
1 changed files with 2 additions and 1 deletions
|
@ -341,8 +341,9 @@ L.Map.TouchGesture = L.Handler.extend({
|
|||
// we need to invert the offset or the map is moved in the opposite direction
|
||||
var offset = {x: e.center.x - this._pinchStartCenter.x, y: e.center.y - this._pinchStartCenter.y};
|
||||
var center = {x: this._pinchStartCenter.x - offset.x, y: this._pinchStartCenter.y - offset.y};
|
||||
this._center = this._map.mouseEventToLatLng({clientX: center.x, clientY: center.y});
|
||||
this._zoom = this._map.getScaleZoom(e.scale);
|
||||
this._center = this._map._limitCenter(this._map.mouseEventToLatLng({clientX: center.x, clientY: center.y}),
|
||||
this._zoom, this._map.options.maxBounds);
|
||||
|
||||
L.Util.cancelAnimFrame(this._animRequest);
|
||||
this._animRequest = L.Util.requestAnimFrame(function () {
|
||||
|
|
Loading…
Reference in a new issue