Skip to content

Commit

Permalink
Merge pull request #5564 from Ronid1/bug/5525_sequence_diagram_fix_no…
Browse files Browse the repository at this point in the history
…te_z_position

Bug/5525 sequence diagram fix note z position
  • Loading branch information
sidharthv96 authored Jun 20, 2024
2 parents a331125 + fb1942c commit 4b21e1e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions cypress/integration/rendering/sequencediagram.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,18 @@ context('Sequence diagram', () => {
{}
);
});
it('should render notes over actors and participant', () => {
imgSnapshotTest(
`
sequenceDiagram
actor Alice
participant Charlie
note over Alice: some note
note over Charlie: other note
`,
{}
);
});
it('should render long messages from an actor to the left to one to the right', () => {
imgSnapshotTest(
`
Expand Down
4 changes: 2 additions & 2 deletions packages/mermaid/src/diagrams/sequence/svgDraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,11 @@ const drawActorTypeActor = async function (elem, actor, conf, isFooter) {
const center = actor.x + actor.width / 2;
const centerY = actorY + 80;

elem.lower();
const line = elem.append('g').lower();

if (!isFooter) {
actorCnt++;
elem
line
.append('line')
.attr('id', 'actor' + actorCnt)
.attr('x1', center)
Expand Down

0 comments on commit 4b21e1e

Please sign in to comment.