Bug 455352 - Stuck kinetic scrolling r=stuart
--- a/mobile/chrome/content/deckbrowser.xml
+++ b/mobile/chrome/content/deckbrowser.xml
@@ -766,16 +766,18 @@
let [destPageX, destPageY] = this._constrainPanCoords(this._screenToPage(this.dragData.dragX
+ this.dragData.velocityX * 800),
this._screenToPage(this.dragData.dragY
+ this.dragData.velocityY * 800));
this.dragData.destinationX = -this._pageToScreen(destPageX);
this.dragData.destinationY = -this._pageToScreen(destPageY);
+ if (this.dragData.kineticId)
+ window.clearInterval(this.dragData.kineticId);
this.dragData.kineticId = window.setInterval(this._doKinetic, dt / (this.PAN_EVENTS_TO_TRACK - 1),
this, dt / (this.PAN_EVENTS_TO_TRACK - 1));
} else {
this._endPan();
}
} else {
this._endPan()
}
@@ -894,40 +896,43 @@
mousedown: function seh_mousedown(aEvent) {
if (aEvent.button != 0)
return;
// cancel any pending canvas updates, since we're going to update again
if (this._updateTimeout)
clearTimeout(this._updateTimeout);
+ // stop any kinetic scrolling
+ var self = this.deckbrowser;
+ if (self.dragData.kineticId)
+ self._endKinetic();
+
var zoomLevel = this.deckbrowser._zoomLevel;
var dragData = this.deckbrowser.dragData;
// The start of the current portion drag
dragData.sX = aEvent.screenX;
dragData.sY = aEvent.screenY;
// The total delta between current mouse position and sX/sY
dragData.dragX = 0;
dragData.dragY = 0;
//this.deckbrowser._updateCanvasPosition();
- var self = this.deckbrowser;
this.deckbrowser._dragStartTimeout = setTimeout(function () {
self._dragStartTimer();
}, 200);
this._lastMouseDown = aEvent;
for (var i = 0; i < self.PAN_EVENTS_TO_TRACK; i++) {
self._panEventTracker[i] = null;
}
- if (self.dragData.kineticId)
- self._endPan();
+
},
mouseup: function seh_mouseup(aEvent) {
if (aEvent.button == 0 && this.deckbrowser.dragData.dragging) {
this.deckbrowser.dragData.dragging = false;
} else if (aEvent.originalTarget == this.deckbrowser._canvas) {
// Mouseup on canvas that isn't releasing from a drag
// cancel scrollStart timer