Skip to content
This repository was archived by the owner on Jun 18, 2018. It is now read-only.

Commit e6b6bc4

Browse files
committed
Adding anchorOffset as a configuration for the drag preview
1 parent 69e872a commit e6b6bc4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/HTML5Backend.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -285,15 +285,19 @@ export default class HTML5Backend {
285285
const sourceId = this.monitor.getSourceId();
286286
const sourceNode = this.sourceNodes[sourceId];
287287
const dragPreview = this.sourcePreviewNodes[sourceId] || sourceNode;
288-
const { anchorX, anchorY } = this.getCurrentSourcePreviewNodeOptions();
288+
const { anchorX, anchorY, anchorOffsetX, anchorOffsetY } = this.getCurrentSourcePreviewNodeOptions();
289289
const anchorPoint = { anchorX, anchorY };
290290
const dragPreviewOffset = getDragPreviewOffset(
291291
sourceNode,
292292
dragPreview,
293293
clientOffset,
294294
anchorPoint
295295
);
296-
dataTransfer.setDragImage(dragPreview, dragPreviewOffset.x, dragPreviewOffset.y);
296+
297+
dataTransfer.setDragImage(dragPreview,
298+
anchorOffsetX === undefined ? dragPreviewOffset.x : anchorOffsetX,
299+
anchorOffsetY === undefined ? dragPreviewOffset.y : anchorOffsetY);
300+
//this is the inlye
297301
}
298302

299303
try {

0 commit comments

Comments
 (0)