Call graph.change() once

This commit is contained in:
Brian Jemilo II
2026-01-23 19:28:24 -06:00
parent 5bb3550fa2
commit 7c00888398
2 changed files with 4 additions and 3 deletions

View File

@@ -219,7 +219,7 @@ describe('ComfyApp', () => {
expect(mockNode2.pos).toEqual([100, 400])
})
it('should call graph change for each node', () => {
it('should call graph change once for all nodes', () => {
const mockNode1 = createMockNode({
getBounding: vi.fn(() => new Float64Array([100, 200, 300, 400]))
})
@@ -230,7 +230,7 @@ describe('ComfyApp', () => {
app.positionBatchNodes([mockNode1, mockNode2, mockNode3], mockBatchNode)
// graph.change() is called for each node in the forEach
expect(mockCanvas.graph?.change).toHaveBeenCalledTimes(3)
expect(mockCanvas.graph?.change).toHaveBeenCalledTimes(1)
})
})

View File

@@ -1563,8 +1563,9 @@ export class ComfyApp {
if (index > 0) {
node.pos = [ x, y + (height * index) + (25 * (index + 1)) ]
}
this.canvas.graph?.change()
});
this.canvas.graph?.change()
}
// @deprecated