[perf] Fix Float32Array test assertions and link adapter

Fix the remaining Float32Array usage that was causing test failures:
- Update test assertions to expect regular arrays instead of Float32Array
- Convert link adapter Float32Array creation to regular arrays

Resolves: AssertionError: expected [ 50, 60 ] to deeply equal Float32Array[ 50, 60 ]
This commit is contained in:
bymyself
2025-09-14 19:41:01 -07:00
parent fca95ad07e
commit 0c6eeb0632
3 changed files with 5 additions and 5 deletions

View File

@@ -84,8 +84,8 @@ describe('LGraphNode', () => {
}))
}
node.configure(configureData)
expect(node.pos).toEqual(new Float32Array([50, 60]))
expect(node.size).toEqual(new Float32Array([70, 80]))
expect(node.pos).toEqual([50, 60])
expect(node.size).toEqual([70, 80])
})
test('should configure inputs correctly', () => {

View File

@@ -449,7 +449,7 @@ export class LitegraphLinkAdapter {
// Copy calculated center position back to litegraph object
// This is needed for hit detection and menu interaction
if (linkData.centerPos) {
linkSegment._pos = linkSegment._pos || new Float32Array(2)
linkSegment._pos = linkSegment._pos || [0, 0]
linkSegment._pos[0] = linkData.centerPos.x
linkSegment._pos[1] = linkData.centerPos.y

View File

@@ -84,8 +84,8 @@ describe('LGraphNode', () => {
}))
}
node.configure(configureData)
expect(node.pos).toEqual(new Float32Array([50, 60]))
expect(node.size).toEqual(new Float32Array([70, 80]))
expect(node.pos).toEqual([50, 60])
expect(node.size).toEqual([70, 80])
})
test('should configure inputs correctly', () => {