Bug 639179 Part 1: Fix waitingForPaint bug when kinetic panning is active r=mbrubeck

This commit is contained in:
Benjamin Stover 2011-04-11 13:52:40 -07:00
Родитель 3713a43a89
Коммит f5144f5433
1 изменённых файлов: 12 добавлений и 10 удалений

Просмотреть файл

@ -328,11 +328,8 @@ MouseModule.prototype = {
if (dragData.isPan()) {
// Only pan when mouse event isn't part of a click. Prevent jittering on tap.
this._kinetic.addData(sX - dragData.prevPanX, sY - dragData.prevPanY);
if (!this._waitingForPaint) {
this._dragBy(this.dX, this.dY);
this.dX = 0;
this.dY = 0;
}
this._dragBy(this.dX, this.dY);
// dragBy will reset dX and dY values to 0.
// Let everyone know when mousemove begins a pan
if (!oldIsPan && dragData.isPan()) {
@ -394,11 +391,16 @@ MouseModule.prototype = {
* the dragger of dragMove()s.
*/
_dragBy: function _dragBy(dX, dY, aIsKinetic) {
let dragData = this._dragData;
let dragged = this._dragger.dragMove(dX, dY, this._targetScrollInterface, aIsKinetic);
if (dragged && !this._waitingForPaint) {
this._waitingForPaint = true;
mozRequestAnimationFrame(this);
let dragged = true;
if (!this._waitingForPaint || aIsKinetic) {
let dragData = this._dragData;
dragged = this._dragger.dragMove(dX, dY, this._targetScrollInterface, aIsKinetic);
if (dragged && !this._waitingForPaint) {
this._waitingForPaint = true;
mozRequestAnimationFrame(this);
}
this.dX = 0;
this.dY = 0;
}
return dragged;
},