Fix drag position handling. close #739

This commit is contained in:
Anton Lavrenov
2019-09-10 12:08:36 -05:00
parent e23c288156
commit f16434d6d8
6 changed files with 1379 additions and 56 deletions

View File

@@ -91,12 +91,14 @@ export const DD = {
// dragBefore and dragAfter allows us to set correct order of events
// setup all in dragbefore, and stop dragging only after pointerup triggered.
_endDragBefore(evt) {
_endDragBefore(evt?) {
DD._dragElements.forEach((elem, key) => {
const { node } = elem;
// we need to find pointer relative to that node
const stage = node.getStage();
stage.setPointersPositions(evt);
if (evt) {
stage.setPointersPositions(evt);
}
const pos = stage._changedPointerPositions.find(
pos => pos.id === elem.pointerId