#2315 Fixing issue with padding between actors and content in sequence diagram

This commit is contained in:
Knut Sveidqvist
2021-09-18 08:26:49 +02:00
parent 9faa5acb21
commit 0fcabfae05
2 changed files with 19 additions and 2 deletions

View File

@@ -74,6 +74,23 @@ Alice->>Bob: Hi Bob
Bob->>Alice: Hi Alice Bob->>Alice: Hi Alice
</div> </div>
<div class="mermaid"> <div class="mermaid">
sequenceDiagram
autonumber
par Action 1
Alice->>John: Hello John, how are you?
and Action 2
Alice->>Bob: Hello Bob, how are you?
end
Alice->>+John: Hello John, how are you?
Alice->>+John: John, can you hear me?
John-->>-Alice: Hi Alice, I can hear you!
Note right of John: John is perceptive
John-->>-Alice: I feel great!
loop Every minute
John-->Alice: Great!
end
</div>
<div class="mermaid">
sequenceDiagram sequenceDiagram
%%{init: {'config': {'wrap': true }}}%% %%{init: {'config': {'wrap': true }}}%%
actor Alice actor Alice

View File

@@ -444,7 +444,7 @@ export const drawActors = function (diagram, actors, actorKeys, verticalPos) {
} }
// Add a margin between the actor boxes and the first arrow // Add a margin between the actor boxes and the first arrow
bounds.bumpVerticalPos(maxHeight-conf.boxMargin); bounds.bumpVerticalPos(maxHeight);
}; };
export const setConf = function (cnf) { export const setConf = function (cnf) {
@@ -689,7 +689,7 @@ export const draw = function (text, id) {
// Draw actors below diagram // Draw actors below diagram
bounds.bumpVerticalPos(conf.boxMargin * 2); bounds.bumpVerticalPos(conf.boxMargin * 2);
drawActors(diagram, actors, actorKeys, bounds.getVerticalPos()); drawActors(diagram, actors, actorKeys, bounds.getVerticalPos());
bounds.bumpVerticalPos(conf.boxMargin*2); bounds.bumpVerticalPos(conf.boxMargin);
fixLifeLineHeights(diagram, bounds.getVerticalPos()); fixLifeLineHeights(diagram, bounds.getVerticalPos());
} }