From de0c11ced924d06bc54b7ef885818ac3e455c548 Mon Sep 17 00:00:00 2001 From: "Xavier.Meng" Date: Tue, 28 Mar 2023 14:30:34 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-14365=20refactor(tracker):=20=E5=A4=9A?= =?UTF-8?q?=E6=9A=B4=E9=9C=B2=E4=B8=AAevent=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/utils/events/mousemovetracker.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/utils/events/mousemovetracker.js b/src/core/utils/events/mousemovetracker.js index 212072ebc..8b8936e76 100644 --- a/src/core/utils/events/mousemovetracker.js +++ b/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); } }; })();