From 6c13791b1aaef685d02bbabab86592d7359b3edd Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sat, 7 May 2022 08:18:35 -0700 Subject: web: add landscape layout --- web/web_scoreboard.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'web/web_scoreboard.c') 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"); -- cgit v1.2.3-70-g09d2