|
|
@ -82,7 +82,7 @@ |
|
|
|
// The mouse may move faster then the animation frame does.
|
|
|
|
// The mouse may move faster then the animation frame does.
|
|
|
|
// Use `requestAnimationFrame` to avoid over-updating.
|
|
|
|
// Use `requestAnimationFrame` to avoid over-updating.
|
|
|
|
this._animationFrameID = |
|
|
|
this._animationFrameID = |
|
|
|
requestAnimationFrame(this._didMouseMove); |
|
|
|
requestAnimationFrame(() => this._didMouseMove(event)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this._x = x; |
|
|
|
this._x = x; |
|
|
@ -90,18 +90,18 @@ |
|
|
|
event.preventDefault ? event.preventDefault() : (event.returnValue = false); |
|
|
|
event.preventDefault ? event.preventDefault() : (event.returnValue = false); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_didMouseMove: function () { |
|
|
|
_didMouseMove: function (event) { |
|
|
|
this._animationFrameID = null; |
|
|
|
this._animationFrameID = null; |
|
|
|
this._onMove(this._deltaX, this._deltaY); |
|
|
|
this._onMove(this._deltaX, this._deltaY, event); |
|
|
|
this._deltaX = 0; |
|
|
|
this._deltaX = 0; |
|
|
|
this._deltaY = 0; |
|
|
|
this._deltaY = 0; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_onMouseUp: function () { |
|
|
|
_onMouseUp: function (event) { |
|
|
|
if (this._animationFrameID) { |
|
|
|
if (this._animationFrameID) { |
|
|
|
this._didMouseMove(); |
|
|
|
this._didMouseMove(event); |
|
|
|
} |
|
|
|
} |
|
|
|
this._onMoveEnd(); |
|
|
|
this._onMoveEnd(event); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
})(); |
|
|
|
})(); |
|
|
|