From 59786b990da7a6c6593cd94ef3384d143940ff91 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Antoine=20Beaupr=C3=A9?= Date: Mon, 2 Dec 2013 23:15:13 -0500 Subject: [PATCH] better wrapping: add a cursor and respect inner borders --- src/oping.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); -- 2.11.0