mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-24 08:24:14 +02:00
Merge commit
This commit is contained in:
@@ -94,6 +94,21 @@ const calcIntersections = (startNodeId, endNodeId, startNodeSize, endNodeSize) =
|
|||||||
const endIntersection = { x: endNodeSize.x, y: endNodeSize.x, pos: 'c' };
|
const endIntersection = { x: endNodeSize.x, y: endNodeSize.x, pos: 'c' };
|
||||||
return [startIntersection, endIntersection];
|
return [startIntersection, endIntersection];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for self loop
|
||||||
|
if (startNodeId === endNodeId) {
|
||||||
|
const intersection = calcIntersectionPoint(startNode, {
|
||||||
|
x: startNode.x + startNode.width / 2 + 20,
|
||||||
|
y: startNode.y + startNode.height / 2,
|
||||||
|
});
|
||||||
|
|
||||||
|
const forthY = startNode.height / 4;
|
||||||
|
return [
|
||||||
|
{ x: intersection.x, y: startNode.y - forthY, pos: 'r' },
|
||||||
|
{ x: intersection.x, y: startNode.y + forthY, pos: 'r' },
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
const endNode = nodeDB.get(endNodeId);
|
const endNode = nodeDB.get(endNodeId);
|
||||||
if (endNodeSize && endNode) {
|
if (endNodeSize && endNode) {
|
||||||
endNode.x = endNodeSize.x;
|
endNode.x = endNodeSize.x;
|
||||||
|
|||||||
Reference in New Issue
Block a user