Fix LGraphNode.pos serialization (#107)

This commit is contained in:
Chenlei Hu
2024-09-02 14:31:05 -04:00
committed by GitHub
parent 8a8ebb4906
commit e25c21026c
2 changed files with 14 additions and 2 deletions

12
test/LGraphNode.test.ts Normal file
View File

@@ -0,0 +1,12 @@
import {
LGraphNode,
} from "../dist/litegraph.es.js";
describe("LGraphNode", () => {
it("should serialize position correctly", () => {
const node = new LGraphNode("TestNode");
node.pos = [10, 10];
expect(node.pos).toEqual(new Float32Array([10, 10]));
expect(node.serialize().pos).toEqual(new Float32Array([10, 10]));
});
});