Skip to content
/ qp-n8n Public
forked from n8n-io/n8n

Commit

Permalink
fix(editor): Fix the canvas node distance when automatically injectin…
Browse files Browse the repository at this point in the history
…g manual trigger (n8n-io#5716)

fix(editor): Fix the canvas node distance when automatically adding manual trigger
  • Loading branch information
OlegIvaniv authored and sunilrr committed Apr 24, 2023
1 parent 816a62a commit 992ce07
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/editor-ui/src/views/NodeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,7 @@ export default mixins(
// If adding more than one node, offset the X position
mousePosition[0] -
NodeViewUtils.NODE_SIZE / 2 +
NodeViewUtils.NODE_SIZE * (index * 2),
NodeViewUtils.NODE_SIZE * (index * 2 + NodeViewUtils.GRID_SIZE),
mousePosition[1] - NodeViewUtils.NODE_SIZE / 2,
] as XYPosition,
dragAndDrop: true,
Expand Down Expand Up @@ -3794,7 +3794,9 @@ export default mixins(
// Position the added node to the right side of the previously added one
lastAddedNode.position = [
previouslyAddedNode.position[0] + NodeViewUtils.NODE_SIZE * 2,
previouslyAddedNode.position[0] +
NodeViewUtils.NODE_SIZE * 2 +
NodeViewUtils.GRID_SIZE,
previouslyAddedNode.position[1],
];
actionWatcher();
Expand Down

0 comments on commit 992ce07

Please sign in to comment.