mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 595229 - Don't pan at start of multitouch zoom gesture [r=stechz]
This commit is contained in:
parent
3d7cd9516f
commit
8db22b2819
@ -1324,6 +1324,11 @@ GestureModule.prototype = {
|
||||
getBrowser().getPosition(scrollX, scrollY);
|
||||
this._pinchScrollX = scrollX.value;
|
||||
this._pinchScrollY = scrollY.value;
|
||||
|
||||
let [centerX, centerY] = Browser.transformClientToBrowser(window.innerWidth / 2,
|
||||
window.innerHeight / 2);
|
||||
this._centerX = centerX;
|
||||
this._centerY = centerY;
|
||||
},
|
||||
|
||||
_pinchUpdate: function _pinchUpdate(aEvent) {
|
||||
@ -1346,8 +1351,8 @@ GestureModule.prototype = {
|
||||
pY += (this._pinchScrollY - scrollY.value) / scale;
|
||||
|
||||
// redraw zoom canvas according to new zoom rect
|
||||
let rect = Browser._getZoomRectForPoint(2 * this._pinchStartX - pX,
|
||||
2 * this._pinchStartY - pY,
|
||||
let rect = Browser._getZoomRectForPoint(this._centerX + this._pinchStartX - pX,
|
||||
this._centerY + this._pinchStartY - pY,
|
||||
this._pinchZoomLevel);
|
||||
this._pinchZoom.updateTo(rect);
|
||||
},
|
||||
|
@ -844,8 +844,8 @@ var Browser = {
|
||||
let scrollX = {}, scrollY = {};
|
||||
tab.browser.getPosition(scrollX, scrollY);
|
||||
|
||||
let centerX = (scrollX.value + window.innerWidth / 2) / oldZoomLevel;
|
||||
let centerY = (scrollY.value + window.innerHeight / 2) / oldZoomLevel;
|
||||
let [centerX, centerY] = this.transformClientToBrowser(window.innerWidth / 2,
|
||||
window.innerHeight / 2);
|
||||
|
||||
let rect = this._getZoomRectForPoint(centerX, centerY, zoomLevel);
|
||||
this.animatedZoomTo(rect);
|
||||
|
Loading…
Reference in New Issue
Block a user