From: Antoine Beaupré Date: Tue, 3 Dec 2013 04:15:13 +0000 (-0500) Subject: better wrapping: add a cursor and respect inner borders X-Git-Tag: liboping-1.7.0~5^2~9 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=59786b990da7a6c6593cd94ef3384d143940ff91;p=liboping.git better wrapping: add a cursor and respect inner borders --- diff --git a/src/oping.c b/src/oping.c index ccaafe0..0649d00 100644 --- a/src/oping.c +++ b/src/oping.c @@ -686,9 +686,10 @@ static int update_stats_from_context (ping_context_t *ctx, pingobj_iter_t *iter) wattron (ctx->window, COLOR_PAIR(color)); mvwprintw (ctx->window, /* y = */ 3, - /* x = */ (1 + sequence) % maxx, + /* x = */ ( (sequence - 1) % (maxx - 4) ) + 2, bars[index]); wattroff (ctx->window, COLOR_PAIR(color)); + wprintw (ctx->window, " "); } else { @@ -698,9 +699,10 @@ static int update_stats_from_context (ping_context_t *ctx, pingobj_iter_t *iter) wattron (ctx->window, COLOR_PAIR(OPING_RED) | A_BOLD); mvwprintw (ctx->window, /* y = */ 3, - /* x = */ (1 + sequence) % maxx, + /* x = */ ( (sequence - 1) % (maxx - 4) ) + 2, "!"); wattroff (ctx->window, COLOR_PAIR(OPING_RED) | A_BOLD); + wprintw (ctx->window, " "); } wrefresh (ctx->window);