rotation bug fixed
This commit is contained in:
@@ -1237,6 +1237,22 @@ ${linksYaml}`;
|
||||
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;
|
||||
|
||||
@@ -1276,6 +1292,7 @@ ${linksYaml}`;
|
||||
createComponentSymbolMetrics,
|
||||
transformPortInfo,
|
||||
getNodePortCanvasPoint,
|
||||
getRotatableNodeHandleDirection,
|
||||
buildPortHandles,
|
||||
buildElementPorts,
|
||||
buildElementPinEntries,
|
||||
|
||||
Reference in New Issue
Block a user