Skip to content

Commit

Permalink
Fix gitgraph branch continues after merge
Browse files Browse the repository at this point in the history
After fixing the initial problem in go-gitea#11981 another
problem has come to light...

Fix go-gitea#11981 (part 2)

Signed-off-by: Andrew Thornton <[email protected]>
  • Loading branch information
zeripath committed Jun 24, 2020
1 parent 81324cf commit 5e84257
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion web_src/js/vendor/gitgraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export default function gitGraph(canvas, rawGraphList, config) {
if ((breakIndex = findLineBreak(nextRow)) !== -1) {
nextRow.splice(breakIndex, 1);
}
}
}
// if line break found replace all '/' with '|' after breakIndex in previous row
if (breakIndex !== -1 && colomn === '/' && colomnIndex > breakIndex) {
currentRow[colomnIndex] = '|';
Expand Down Expand Up @@ -372,6 +372,10 @@ export default function gitGraph(canvas, rawGraphList, config) {
inlineIntersect = false;
}

if (colomn === '|' && currentRow[colomnIndex - 1] && currentRow[colomnIndex - 1] === '\\') {
flows.splice(colomnIndex, 0, genNewFlow());
}

color = flows[colomnIndex].color;

switch (colomn) {
Expand All @@ -387,6 +391,10 @@ export default function gitGraph(canvas, rawGraphList, config) {
break;

case '|':
if (prevColomn
&& prevColomn === '\\') {
x += config.unitSize;
}
drawLineUp(x, y, color);
break;

Expand Down

0 comments on commit 5e84257

Please sign in to comment.