Project

General

Profile

Patch #22278 » 0001-Check-for-vertical-align-when-computing-positions-in.patch

Gregor Schmidt, 2016-03-17 15:52

View differences:

public/javascripts/revision_graph.js
24 24
        graph_right_side = graph_x_offset + (graph_space + 1) * XSTEP,
25 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 39
    revisionGraph.setSize(graph_right_side, graph_bottom);
28 40

  
29 41
    // init colors
......
41 53
        if (!commit.hasOwnProperty("space"))
42 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 57
        x = graph_x_offset + XSTEP / 2 + XSTEP * commit.space;
46 58
        revisionGraph.circle(x, y, 3)
47 59
            .attr({
......
55 67
                if (!parent_commit.hasOwnProperty("space"))
56 68
                    parent_commit.space = 0;
57 69

  
58
                parent_y = commit_table_rows.eq(max_rdmid - parent_commit.rdmid).position().top - graph_y_offset + CIRCLE_INROW_OFFSET;
70
                parent_y = yForRow(max_rdmid - parent_commit.rdmid);
59 71
                parent_x = graph_x_offset + XSTEP / 2 + XSTEP * parent_commit.space;
60 72
                if (parent_commit.space == commit.space) {
61 73
                    // vertical path
(1-1/5)