mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
Swap condition blocks to avoid using negation
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user