diff options
Diffstat (limited to 'ui-commit.c')
-rw-r--r-- | ui-commit.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/ui-commit.c b/ui-commit.c index b6a106f..8011dfc 100644 --- a/ui-commit.c +++ b/ui-commit.c | |||
@@ -29,7 +29,6 @@ void print_fileinfo(struct fileinfo *info) | |||
29 | { | 29 | { |
30 | char *query, *query2; | 30 | char *query, *query2; |
31 | char *class; | 31 | char *class; |
32 | double width; | ||
33 | 32 | ||
34 | switch (info->status) { | 33 | switch (info->status) { |
35 | case DIFF_STATUS_ADDED: | 34 | case DIFF_STATUS_ADDED: |
@@ -96,18 +95,15 @@ void print_fileinfo(struct fileinfo *info) | |||
96 | } | 95 | } |
97 | html("</td><td class='right'>"); | 96 | html("</td><td class='right'>"); |
98 | htmlf("%d", info->added + info->removed); | 97 | htmlf("%d", info->added + info->removed); |
99 | |||
100 | html("</td><td class='graph'>"); | 98 | html("</td><td class='graph'>"); |
101 | width = (info->added + info->removed) * 100.0 / max_changes; | 99 | htmlf("<table width='%d%%'><tr>", (max_changes > 100 ? 100 : max_changes)); |
102 | if (width < 0.1) | 100 | htmlf("<td class='add' style='width: %.1f%%;'/>", |
103 | width = 0.1; | 101 | info->added * 100.0 / max_changes); |
104 | html_link_open(cgit_pageurl(cgit_query_repo, "diff", query), | 102 | htmlf("<td class='rem' style='width: %.1f%%;'/>", |
105 | NULL, NULL); | 103 | info->removed * 100.0 / max_changes); |
106 | htmlf("<img src='/cgit/add.png' style='width: %.1f%%;'/>", | 104 | htmlf("<td class='none' style='width: %.1f%%;'/>", |
107 | info->added * width / (info->added + info->removed)); | 105 | (max_changes - info->removed - info->added) * 100.0 / max_changes); |
108 | htmlf("<img src='/cgit/del.png' style='width: %.1f%%;'/>", | 106 | html("</tr></table></a></td></tr>\n"); |
109 | info->removed * width / (info->added + info->removed)); | ||
110 | html("</a></td></tr>\n"); | ||
111 | } | 107 | } |
112 | 108 | ||
113 | void cgit_count_diff_lines(char *line, int len) | 109 | void cgit_count_diff_lines(char *line, int len) |