This commit is contained in:
xsxx03-art
2026-06-04 15:17:02 +08:00
parent 9b4f43f0b1
commit 960066735c
30 changed files with 1172 additions and 315 deletions
+9 -12
View File
@@ -42,8 +42,8 @@
name: 'Anchor',
elementType: 'anchor',
ports: {
a1: { x: 0, y: -PORT_NODE_SIZE / 2, a: 180, width: 0.5 },
b1: { x: 0, y: -PORT_NODE_SIZE / 2, a: 0, width: 0.5 }
a1: { x: 0, y: 0, a: 180, width: 0.5 },
b1: { x: 0, y: 0, a: 0, width: 0.5 }
}
}
};
@@ -807,16 +807,13 @@
}
};
}
if (portNumber > 1) {
const entries = [];
Array.from({ length: portNumber }, (_, index) => {
const y = elementPortOffset(index, portNumber, pitch);
entries.push([`a${index + 1}`, { x: 0, y, a: 180, width }]);
entries.push([`b${index + 1}`, { x: 0, y, a: 0, width }]);
});
return Object.fromEntries(entries);
}
return JSON.parse(JSON.stringify(element.ports));
const entries = [];
Array.from({ length: portNumber }, (_, index) => {
const y = elementPortOffset(index, portNumber, pitch);
entries.push([`a${index + 1}`, { x: 0, y, a: 180, width }]);
entries.push([`b${index + 1}`, { x: 0, y, a: 0, width }]);
});
return Object.fromEntries(entries);
};
// Generate port metadata for built-in primitive components.