Skip to content

Commit

Permalink
Swap condition blocks to avoid using negation
Browse files Browse the repository at this point in the history
  • Loading branch information
mathbraga committed Jan 22, 2024
1 parent e668698 commit 81825f2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/mermaid/src/diagrams/git/gitGraphRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit 81825f2

Please sign in to comment.