fix: make clipboard work

This commit is contained in:
Max Richter
2025-12-01 19:30:44 +01:00
parent 7e51cc5ea1
commit 1850e21810
3 changed files with 22 additions and 23 deletions

View File

@@ -397,17 +397,17 @@ export class GraphManager extends EventEmitter<{
}
createNodeId() {
const max = Math.max(0, ...this.nodes.keys());
return max + 1;
return Math.max(0, ...this.nodes.keys()) + 1;
}
createGraph(nodes: Node[], edges: [number, number, number, string][]) {
// map old ids to new ids
const idMap = new Map<number, number>();
let startId = this.createNodeId()
nodes = nodes.map((node) => {
const id = this.createNodeId();
const id = startId++;
idMap.set(node.id, id);
const type = this.registry.getNode(node.type);
if (!type) {