fix(nodes): always drag draggable node even if not selected

This commit is contained in:
moklick
2020-11-05 14:36:26 +01:00
parent 0774d35846
commit 7e55f8c07f
3 changed files with 5 additions and 2 deletions
+2 -2
View File
@@ -263,9 +263,9 @@ export const storeModel: StoreModel = {
});
}),
updateNodePosDiff: action((state, { diff = null, isDragging = true }) => {
updateNodePosDiff: action((state, { id = null, diff = null, isDragging = true }) => {
state.elements.forEach((n) => {
if (isNode(n) && state.selectedElements?.find((sNode) => sNode.id === n.id)) {
if (isNode(n) && (id === n.id || state.selectedElements?.find((sNode) => sNode.id === n.id))) {
if (diff) {
n.__rf.position = {
x: n.__rf.position.x + diff.x,