mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
Call graph.change() once
This commit is contained in:
@@ -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)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user