| 63 |
63 |
fill: colors[commit.space],
|
| 64 |
64 |
stroke: 'none'
|
| 65 |
65 |
}).toFront();
|
| 66 |
|
// paths to parents
|
| 67 |
|
$.each(commit.parent_scmids, function(index, parent_scmid) {
|
| 68 |
|
parent_commit = commits_by_scmid[parent_scmid];
|
|
66 |
|
|
67 |
// check for parents in the same column
|
|
68 |
let noVerticalParents = true;
|
|
69 |
$.each(commit.parent_scmids, function (index, parentScmid) {
|
|
70 |
parent_commit = commits_by_scmid[parentScmid];
|
| 69 |
71 |
if (parent_commit) {
|
| 70 |
72 |
if (!parent_commit.hasOwnProperty("space"))
|
| 71 |
73 |
parent_commit.space = 0;
|
| 72 |
74 |
|
|
75 |
// has parent in the same column on this page
|
|
76 |
if (parent_commit.space === commit.space)
|
|
77 |
noVerticalParents = false;
|
|
78 |
} else {
|
|
79 |
// has parent in the same column on the other page
|
|
80 |
noVerticalParents = false;
|
|
81 |
}
|
|
82 |
});
|
|
83 |
|
|
84 |
// paths to parents
|
|
85 |
$.each(commit.parent_scmids, function(index, parent_scmid) {
|
|
86 |
parent_commit = commits_by_scmid[parent_scmid];
|
|
87 |
if (parent_commit) {
|
| 73 |
88 |
parent_y = yForRow(max_rdmid - parent_commit.rdmid);
|
| 74 |
89 |
parent_x = graph_x_offset + XSTEP / 2 + XSTEP * parent_commit.space;
|
| 75 |
|
if (parent_commit.space == commit.space) {
|
|
90 |
const controlPointDelta = (parent_y - y) / 8;
|
|
91 |
|
|
92 |
if (parent_commit.space === commit.space) {
|
| 76 |
93 |
// vertical path
|
| 77 |
94 |
path = revisionGraph.path([
|
| 78 |
95 |
'M', x, y,
|
| 79 |
96 |
'V', parent_y]);
|
|
97 |
} else if (noVerticalParents) {
|
|
98 |
// branch start (Bezier curve)
|
|
99 |
path = revisionGraph.path([
|
|
100 |
'M', x, y,
|
|
101 |
'C', x, y + controlPointDelta, x, parent_y - controlPointDelta, parent_x, parent_y]);
|
|
102 |
} else if (!parent_commit.hasOwnProperty('vertical_children')) {
|
|
103 |
// branch end (Bezier curve)
|
|
104 |
path = revisionGraph.path([
|
|
105 |
'M', x, y,
|
|
106 |
'C', parent_x, y + controlPointDelta, parent_x, parent_y, parent_x, parent_y]);
|
| 80 |
107 |
} else {
|
| 81 |
108 |
// path to a commit in a different branch (Bezier curve)
|
| 82 |
109 |
path = revisionGraph.path([
|
| 83 |
110 |
'M', x, y,
|
| 84 |
|
'C', x, y, x, y + (parent_y - y) / 2, x + (parent_x - x) / 2, y + (parent_y - y) / 2,
|
| 85 |
|
'C', x + (parent_x - x) / 2, y + (parent_y - y) / 2, parent_x, parent_y-(parent_y-y)/2, parent_x, parent_y]);
|
|
111 |
'C', parent_x, y, x, parent_y, parent_x, parent_y]);
|
| 86 |
112 |
}
|
| 87 |
113 |
} else {
|
| 88 |
114 |
// vertical path ending at the bottom of the revisionGraph
|