Merge pull request 'rotation bug fixed' (#9) from jingwen_main into qinyue_main

Reviewed-on: #9
This commit was merged in pull request #9.
This commit is contained in:
2026-06-09 12:17:23 +00:00
2 changed files with 47 additions and 11 deletions
+17
View File
@@ -1282,6 +1282,22 @@ bundles:${groupsYaml ? `\n${groupsYaml}` : ' {}'}`;
return null;
};
const getRotatableNodeHandleDirection = (node, handleId) => {
if (!node || !handleId) return null;
if (node.type !== 'rotatableNode' && !(!node.data?.elementType && node.data?.componentName)) return null;
const ports = node.data && node.data.ports;
if (!ports || !ports[handleId]) return null;
const boxSize = normalizeBoxSize({ box_size: node.data && node.data.boxSize }, DEFAULT_COMPONENT_BOX_SIZE);
const handles = buildPortHandles(ports, {
rotation: Number((node.data && node.data.rotation) || 0),
flip: Boolean(node.data && node.data.flip),
flop: Boolean(node.data && node.data.flop),
boxSize
});
const found = handles.find(handle => handle.name === handleId);
return found ? found.position : null;
};
// Backward-compatible alias for same-type route crossing validation.
const findSameFamilyRouteCrossing = findSameTypeRouteCrossing;
@@ -1324,6 +1340,7 @@ bundles:${groupsYaml ? `\n${groupsYaml}` : ' {}'}`;
createComponentSymbolMetrics,
transformPortInfo,
getNodePortCanvasPoint,
getRotatableNodeHandleDirection,
buildPortHandles,
buildElementPorts,
buildElementPinEntries,