src/Draggable/Plugins/Mirror/Mirror.js
function calculateMirrorOffset({sensorEvent, sourceRect, options, ...args}) {
  return withPromise((resolve) => {
    const top = options.cursorOffsetY === null ? sensorEvent.clientY - sourceRect.top : options.cursorOffsetY;
    const left = options.cursorOffsetX === null ? sensorEvent.clientX - sourceRect.left : options.cursorOffsetX;

    const mirrorOffset = {top, left};

    resolve({sensorEvent, sourceRect, mirrorOffset, options, ...args});
  });
}
function calculateMirrorOffset({sensorEvent, sourceRect, options, ...args}) {
  return withPromise((resolve) => {
    const top = options.cursorOffsetY === null ? sensorEvent.clientY - sourceRect.top : options.cursorOffsetY;
    const left = options.cursorOffsetX === null ? sensorEvent.clientX - sourceRect.left : options.cursorOffsetX;

    const mirrorOffset = {top, left};

    resolve({sensorEvent, sourceRect, mirrorOffset, options, ...args});
  });
}
function calculateMirrorOffset ( { sensorEvent , sourceRect , options , ... args } ) { return withPromise ( ( resolve ) => { const top = options . cursorOffsetY === null ? sensorEvent . clientY - sourceRect . top : options . cursorOffsetY ; const left = options . cursorOffsetX === null ? sensorEvent . clientX - sourceRect . left : options . cursorOffsetX ; const mirrorOffset = { top , left } ; resolve ( { sensorEvent , sourceRect , mirrorOffset , options , ... args } ) ; } ) ; }
Calculates mirror offset
Adds mirrorOffset to state
@param {Object} state
@param {SensorEvent} state.sensorEvent
@param {DOMRect} state.sourceRect
@return {Promise}
@private
Calculates mirror offset Adds mirrorOffset to state