diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js index 87dd69738..10933a574 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js @@ -1297,7 +1297,13 @@ RED.view = (function() { if (snapGrid != d3.event.shiftKey && moving_set.length > 0) { var gridOffset = [0,0]; node = moving_set[0]; - gridOffset[0] = node.n.x-(gridSize*Math.floor((node.n.x-node.n.w/2)/gridSize)+node.n.w/2); + if (vertical) { + // Align to the centre point of the node + gridOffset[0] = node.n.x-(gridSize*Math.floor(node.n.x/gridSize)); + } else { + // Align to the left edge of the node + gridOffset[0] = node.n.x-(gridSize*Math.floor((node.n.x-node.n.w/2)/gridSize)+node.n.w/2); + } gridOffset[1] = node.n.y-(gridSize*Math.floor(node.n.y/gridSize)); if (gridOffset[0] !== 0 || gridOffset[1] !== 0) { for (i = 0; i