diff --git a/packages/modifiers/base.js b/packages/modifiers/base.js index 9350d1423..a09dbc11e 100644 --- a/packages/modifiers/base.js +++ b/packages/modifiers/base.js @@ -37,8 +37,7 @@ function init (scope) { } function startAll (arg) { - const { interaction, statuses, rect, pageCoords: page } = arg; - const { modifiers: { startOffset } } = interaction; + const { statuses, startOffset, rect, pageCoords: page } = arg; if (rect) { startOffset.left = page.x - rect.left; @@ -66,11 +65,12 @@ function setAll (arg) { arg.modifiedCoords = extend({}, arg.pageCoords); const result = { - delta: { x: 0, y: 0 }, coords: arg.modifiedCoords, shouldMove: true, }; + resetStatus(result); + for (const status of statuses) { const { options } = status; @@ -105,11 +105,13 @@ function prepareStatuses (modifierList) { for (const { options, methods } of modifierList) { if (!options || options.enabled === false) { continue; } - statuses.push({ + const status = { options, methods, - delta: { x: 0, y: 0 }, - }); + }; + + resetStatus(status); + statuses.push(status); } return statuses; @@ -128,6 +130,7 @@ function start ({ interaction, phase }, modifiers, pageCoords) { const arg = { interaction, interactable, + element, pageCoords, phase, rect, @@ -148,6 +151,8 @@ function beforeMove ({ interaction, phase, preEnd }, modifiers) { const modifierResult = setAll( { interaction, + interactable: interaction.target, + element: interaction.elemnet, preEnd, phase, pageCoords: interaction.coords.cur.page,