From f96d351fdc754da8a93688978b6893aa5239cf62 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Thu, 28 Sep 2023 13:09:56 +0530 Subject: [PATCH] fix: Sequence loop rendering --- packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts b/packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts index 058646dc8b..a41c3877fe 100644 --- a/packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts +++ b/packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts @@ -1421,8 +1421,7 @@ const buildMessageModel = function (msg, actors, diagObj) { return isArrowToRight ? -value : value; }; - // 3 is max difference for +/- 1 - if (Math.abs(startx - stopx) <= 3) { + if (msg.from === msg.to) { // This is a self reference, so we need to make sure the arrow is drawn correctly // There are many checks in the downstream rendering that checks for equality. // The lines on loops will be off by few pixels, but that's fine for now.