This commit is contained in:
Knut Sveidqvist 2020-07-04 11:13:54 +02:00
parent 7e9ab546eb
commit 32b2ee8cab
2 changed files with 11 additions and 15 deletions

View File

@ -33,23 +33,18 @@ flowchart BT
c1 --apa apa apa--> b1 c1 --apa apa apa--> b1
two --> c2 two --> c2
</div> </div>
<div class="mermaid" style="width: 50%; height: 20%;"> <div class="mermaid" style="width: 50%; height: 200px;">
sequenceDiagram sequenceDiagram
Alice->>Bob:Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be Alice->>Bob:Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
Bob->>Alice: I'm short though Bob->>Alice: I'm short though
</div> </div>
<div class="mermaid2" style="width: 50%; height: 20%;"> <div class="mermaid" style="width: 50%; height: 200px;">
flowchart TB %%{init: {'config': {'wrap': true }}}%%
subgraph two sequenceDiagram
b1 participant A as Extremely utterly
end A->>Bob: long line of longness which had preivously overflown the actor box as it is much longer than what it should be
subgraph three Bob-->A: Pasten ! </div>
c1-->c2 <div class="mermaid2" style="width: 50%; height: 200px;">
end
c1 --apa apa apa--> b1
b1 --> c2
</div>
<div class="mermaid" style="width: 50%; height: 20%;">
flowchart BT flowchart BT
subgraph a subgraph a

View File

@ -248,6 +248,7 @@ const drawNote = function(elem, noteModel) {
* @param msgModel - the model containing fields describing a message * @param msgModel - the model containing fields describing a message
*/ */
const drawMessage = function(g, msgModel) { const drawMessage = function(g, msgModel) {
bounds.bumpVerticalPos(10);
const { startx, stopx, starty, message, type, sequenceIndex, wrap } = msgModel; const { startx, stopx, starty, message, type, sequenceIndex, wrap } = msgModel;
const lines = common.splitBreaks(message).length; const lines = common.splitBreaks(message).length;
let textDims = utils.calculateTextDimensions(message, conf.messageFont()); let textDims = utils.calculateTextDimensions(message, conf.messageFont());
@ -257,7 +258,7 @@ const drawMessage = function(g, msgModel) {
bounds.bumpVerticalPos(lineHeight); bounds.bumpVerticalPos(lineHeight);
const textObj = svgDraw.getTextObj(); const textObj = svgDraw.getTextObj();
textObj.x = startx; textObj.x = startx;
textObj.y = starty; textObj.y = starty + 10;
textObj.width = stopx - startx; textObj.width = stopx - startx;
textObj.class = 'messageText'; textObj.class = 'messageText';
textObj.dy = '1em'; textObj.dy = '1em';
@ -273,7 +274,7 @@ const drawMessage = function(g, msgModel) {
drawText(g, textObj); drawText(g, textObj);
let totalOffset = textDims.height; let totalOffset = textDims.height - 10;
let textWidth = textDims.width; let textWidth = textDims.width;