Browse Source

Merge pull request #3468 in VISUAL/fineui from DEC/fineui:release/11.0 to master

* commit 'c849674bbecf6045e84bd1824ef2d201416755fe':
  KERNEL-14365 refactor(tracker): 多暴露个event对象
research/test
Aeolus.Zhang-张敬峥 1 year ago
parent
commit
3900c402b7
  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. // 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);
} }
}; };
})(); })();

Loading…
Cancel
Save