[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
committed by DrJKL
parent 58024fb4f4
commit ba4c3525f4
3 changed files with 5 additions and 5 deletions

View File

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

View File

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

View File

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