Browse Source

Merge pull request #230374 in DEC/fineui from bugfix/11.0 to feature/x

* commit '02f857237d2f198a438c0917c9c249cbfc222192':
  KERNEL-14365 refactor(tracker): 多暴露个event对象
master
superman 2 years ago
parent
commit
3df1172a03
  1. 12
      src/core/utils/events/mousemovetracker.js

12
src/core/utils/events/mousemovetracker.js

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

Loading…
Cancel
Save