mirror of
https://github.com/node-red/node-red.git
synced 2025-12-27 23:34:38 +01:00
Better grid snapping for suggestion auto-placement
This commit is contained in:
@@ -6527,7 +6527,7 @@ RED.view = (function() {
|
||||
const positionOffset = { x: 0, y: 0 }
|
||||
if (suggestion.source && suggestion.position === 'relative') {
|
||||
// If the suggestion is relative to a source node, use its position plus a suitable offset
|
||||
let targetX = suggestion.source.x + (suggestion.source.w || 120) / 2 + 77
|
||||
let targetX = suggestion.source.x + (suggestion.source.w || 120) + (3 * gridSize)
|
||||
const targetY = suggestion.source.y
|
||||
// Keep targetY where it is, but ensure targetX is grid aligned
|
||||
if (snapGrid) {
|
||||
|
||||
Reference in New Issue
Block a user