Merge pull request #1335 from GDFaber/bug/1271_fix_autonumber_position_for_multiline_texts
#1271 Fix autonumber positioning in sequence diagrams with multiline texts
This commit is contained in:
commit
a4a19845d4
|
@ -182,5 +182,18 @@ context('Sequence diagram', () => {
|
|||
{}
|
||||
);
|
||||
});
|
||||
it('should render autonumber with different line breaks', () => {
|
||||
imgSnapshotTest(
|
||||
`
|
||||
sequenceDiagram
|
||||
autonumber
|
||||
Alice->>John: Hello John,<br>how are you?
|
||||
Alice->>John: John,<br/>can you hear me?
|
||||
John-->>Alice: Hi Alice,<br />I can hear you!
|
||||
John-->>Alice: I feel great!
|
||||
`,
|
||||
{}
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -441,6 +441,14 @@ end
|
|||
4->>1: multiline<br />using #lt;br /#gt;
|
||||
note right of 1: multiline<br />using #lt;br /#gt;
|
||||
</div>
|
||||
<div class="mermaid">
|
||||
sequenceDiagram
|
||||
autonumber
|
||||
Alice->>John: Hello John,<br>how are you?
|
||||
Alice->>John: John,<br/>can you hear me?
|
||||
John-->>Alice: Hi Alice,<br />I can hear you!
|
||||
John-->>Alice: I feel great!
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
|
||||
|
|
|
@ -362,7 +362,7 @@ const drawMessage = function(elem, startx, stopx, verticalPos, msg, sequenceInde
|
|||
line.attr('marker-start', 'url(' + url + '#sequencenumber)');
|
||||
g.append('text')
|
||||
.attr('x', startx)
|
||||
.attr('y', verticalPos + 4)
|
||||
.attr('y', verticalPos + 4 + totalOffset)
|
||||
.attr('font-family', 'sans-serif')
|
||||
.attr('font-size', '12px')
|
||||
.attr('text-anchor', 'middle')
|
||||
|
|
Loading…
Reference in New Issue