@@ -24,6 +24,18 function drawRevisionGraph(holder, commits_hash, graph_space) { | |||||
24 | graph_right_side = graph_x_offset + (graph_space + 1) * XSTEP, |
|
24 | graph_right_side = graph_x_offset + (graph_space + 1) * XSTEP, | |
25 | graph_bottom = commit_table_rows.last().position().top + commit_table_rows.last().height() - graph_y_offset; |
|
25 | graph_bottom = commit_table_rows.last().position().top + commit_table_rows.last().height() - graph_y_offset; | |
26 |
|
26 | |||
|
27 | ||||
|
28 | var yForRow = function (index, commit) { | |||
|
29 | var row = commit_table_rows.eq(index); | |||
|
30 | ||||
|
31 | switch (row.find("td:first").css("vertical-align")) { | |||
|
32 | case "middle": | |||
|
33 | return row.position().top + (row.height() / 2) - graph_y_offset; | |||
|
34 | default: | |||
|
35 | return row.position().top + - graph_y_offset + CIRCLE_INROW_OFFSET; | |||
|
36 | } | |||
|
37 | }; | |||
|
38 | ||||
27 | revisionGraph.setSize(graph_right_side, graph_bottom); |
|
39 | revisionGraph.setSize(graph_right_side, graph_bottom); | |
28 |
|
40 | |||
29 | // init colors |
|
41 | // init colors | |
@@ -41,7 +53,7 function drawRevisionGraph(holder, commits_hash, graph_space) { | |||||
41 | if (!commit.hasOwnProperty("space")) |
|
53 | if (!commit.hasOwnProperty("space")) | |
42 | commit.space = 0; |
|
54 | commit.space = 0; | |
43 |
|
55 | |||
44 | y = commit_table_rows.eq(max_rdmid - commit.rdmid).position().top - graph_y_offset + CIRCLE_INROW_OFFSET; |
|
56 | y = yForRow(max_rdmid - commit.rdmid); | |
45 | x = graph_x_offset + XSTEP / 2 + XSTEP * commit.space; |
|
57 | x = graph_x_offset + XSTEP / 2 + XSTEP * commit.space; | |
46 | revisionGraph.circle(x, y, 3) |
|
58 | revisionGraph.circle(x, y, 3) | |
47 | .attr({ |
|
59 | .attr({ | |
@@ -55,7 +67,7 function drawRevisionGraph(holder, commits_hash, graph_space) { | |||||
55 | if (!parent_commit.hasOwnProperty("space")) |
|
67 | if (!parent_commit.hasOwnProperty("space")) | |
56 | parent_commit.space = 0; |
|
68 | parent_commit.space = 0; | |
57 |
|
69 | |||
58 |
parent_y = |
|
70 | parent_y = yForRow(max_rdmid - parent_commit.rdmid); | |
59 | parent_x = graph_x_offset + XSTEP / 2 + XSTEP * parent_commit.space; |
|
71 | parent_x = graph_x_offset + XSTEP / 2 + XSTEP * parent_commit.space; | |
60 | if (parent_commit.space == commit.space) { |
|
72 | if (parent_commit.space == commit.space) { | |
61 | // vertical path |
|
73 | // vertical path |
General Comments 0
You need to be logged in to leave comments.
Login now