mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-02-04 07:13:25 +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];
|
const commit = commits[key];
|
||||||
|
|
||||||
if (isParallelCommits) {
|
if (isParallelCommits) {
|
||||||
if (!commit.parents.length) {
|
if (commit.parents.length) {
|
||||||
pos = 0;
|
|
||||||
if (dir === 'TB') {
|
|
||||||
pos = 30;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
const closestParent = findClosestParent(commit.parents);
|
const closestParent = findClosestParent(commit.parents);
|
||||||
pos =
|
pos =
|
||||||
dir === 'TB'
|
dir === 'TB'
|
||||||
? commitPos[closestParent].y + commitStep
|
? commitPos[closestParent].y + commitStep
|
||||||
: commitPos[closestParent].x + commitStep;
|
: commitPos[closestParent].x + commitStep;
|
||||||
|
} else {
|
||||||
|
pos = 0;
|
||||||
|
if (dir === 'TB') {
|
||||||
|
pos = 30;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user