mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
fix: use Reroute.move() to sync layout store on paste
This commit is contained in:
@@ -4027,15 +4027,14 @@ export class LGraphCanvas implements CustomEventDispatcher<LGraphCanvasEventMap>
|
||||
}
|
||||
}
|
||||
|
||||
// Adjust positions
|
||||
// Adjust positions - use move/setPos to ensure layout store is updated
|
||||
const dx = position[0] - offsetX
|
||||
const dy = position[1] - offsetY
|
||||
for (const item of created) {
|
||||
const newX = item.pos[0] + position[0] - offsetX
|
||||
const newY = item.pos[1] + position[1] - offsetY
|
||||
if (item instanceof LGraphNode) {
|
||||
item.setPos(newX, newY)
|
||||
} else {
|
||||
item.pos[0] = newX
|
||||
item.pos[1] = newY
|
||||
item.setPos(item.pos[0] + dx, item.pos[1] + dy)
|
||||
} else if (item instanceof Reroute) {
|
||||
item.move(dx, dy)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user