summaryrefslogtreecommitdiffabout
path: root/ui-commit.c
Unidiff
Diffstat (limited to 'ui-commit.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-commit.c20
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
@@ -31,3 +31,2 @@ void print_fileinfo(struct fileinfo *info)
31 char *class; 31 char *class;
32 double width;
33 32
@@ -98,14 +97,11 @@ void print_fileinfo(struct fileinfo *info)
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}