diff --git a/lib/forcegraph.js b/lib/forcegraph.js index 3d06055..7fda8fb 100644 --- a/lib/forcegraph.js +++ b/lib/forcegraph.js @@ -60,6 +60,9 @@ define(["d3"], function (d3) { d3.event.sourceEvent.stopPropagation() d3.event.sourceEvent.preventDefault() draggedNode.fixed |= 2 + + draggedNode.px = draggedNode.x + draggedNode.py = draggedNode.y } function dragmove() { @@ -76,7 +79,7 @@ define(["d3"], function (d3) { if (draggedNode) { d3.event.sourceEvent.stopPropagation() d3.event.sourceEvent.preventDefault() - draggedNode.fixed &= 1 + draggedNode.fixed &= ~2 draggedNode = undefined } }