diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-05-07 08:18:35 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-05-07 08:18:35 -0700 |
commit | 6c13791b1aaef685d02bbabab86592d7359b3edd (patch) | |
tree | 816c82a48d0721b50a50982ba220b320b1d00699 /web/web_scoreboard.c | |
parent | f1c451bafb2dd4a3c61cbb2072b5d5ffe5726842 (diff) | |
download | dartboat-6c13791b1aaef685d02bbabab86592d7359b3edd.tar.gz dartboat-6c13791b1aaef685d02bbabab86592d7359b3edd.tar.xz |
web: add landscape layout
Diffstat (limited to 'web/web_scoreboard.c')
-rw-r--r-- | web/web_scoreboard.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/web/web_scoreboard.c b/web/web_scoreboard.c index 6207d4a..8746cc9 100644 --- a/web/web_scoreboard.c +++ b/web/web_scoreboard.c @@ -177,6 +177,11 @@ void draw_visits() struct dom_elem **elemv = malloc(6 * (n_visits + 1) * sizeof(*elemv)); int elemc = 0; + elemv[elemc++] = create_div(state->legs[0]->name, "visit-name1"); + if (state->mode != M_P) + elemv[elemc++] = create_div(state->legs[1]->name, + "visit-name2"); + char buf[32], buf2[32]; snprintf(buf, sizeof(buf), "%d", state->legs[0]->start); elemv[elemc++] = create_div(buf, "visit-col2"); @@ -213,10 +218,11 @@ void draw_visits() elemv[elemc++] = create_div(buf, buf2); if (v->n_darts) { + char *ptr = buf; for (int j = 0; j < v->n_darts; ++j) { char *n = segment_name(v->darts[j]); - snprintf(buf + (j * 5), sizeof(buf) - (j * 5), - " %4s", n); + ptr += snprintf(ptr, sizeof(buf) - (ptr - buf), + j == 0 ? "%s" : "-%s", n); free(n); } elemv[elemc++] = create_div(buf, "visit-col6"); |