mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Swap condition blocks to avoid using negation
This commit is contained in:
parent
e668698b5c
commit
81825f22f5
@ -118,17 +118,17 @@ const drawCommits = (svg, commits, modifyGraph) => {
|
||||
const commit = commits[key];
|
||||
|
||||
if (isParallelCommits) {
|
||||
if (!commit.parents.length) {
|
||||
pos = 0;
|
||||
if (dir === 'TB') {
|
||||
pos = 30;
|
||||
}
|
||||
} else {
|
||||
if (commit.parents.length) {
|
||||
const closestParent = findClosestParent(commit.parents);
|
||||
pos =
|
||||
dir === 'TB'
|
||||
? commitPos[closestParent].y + commitStep
|
||||
: commitPos[closestParent].x + commitStep;
|
||||
} else {
|
||||
pos = 0;
|
||||
if (dir === 'TB') {
|
||||
pos = 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user