diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-08-26 16:23:30 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-08-26 16:23:30 +0000 |
commit | ddf97f8289df9c7973e7dad6dae8949e29792a16 (patch) | |
tree | 8f5a1821e83801c0033f06c013bd3d80b1dfcfad | |
parent | 1ba5ce9cb3992f3a5f7ff41975c370540678e815 (diff) | |
download | rtmux-ddf97f8289df9c7973e7dad6dae8949e29792a16.tar.gz rtmux-ddf97f8289df9c7973e7dad6dae8949e29792a16.tar.bz2 rtmux-ddf97f8289df9c7973e7dad6dae8949e29792a16.zip |
Make this work when the clock is in small characters as well. Doh.
-rw-r--r-- | clock.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -112,8 +112,6 @@ clock_draw(struct screen_write_ctx *ctx, u_int colour, int style) strftime(tim, sizeof tim, "%H:%M", localtime(&t)); screen_write_clearscreen(ctx); - memcpy(&gc, &grid_default_cell, sizeof gc); - gc.bg = colour; if (screen_size_x(s) < 6 * strlen(tim) || screen_size_y(s) < 6) { if (screen_size_x(s) >= strlen(tim) && screen_size_y(s) != 0) { @@ -121,6 +119,7 @@ clock_draw(struct screen_write_ctx *ctx, u_int colour, int style) y = screen_size_y(s) / 2; screen_write_cursormove(ctx, x, y); + memcpy(&gc, &grid_default_cell, sizeof gc); gc.fg = colour; screen_write_puts(ctx, &gc, "%s", tim); } @@ -130,6 +129,8 @@ clock_draw(struct screen_write_ctx *ctx, u_int colour, int style) x = (screen_size_x(s) / 2) - 3 * strlen(tim); y = (screen_size_y(s) / 2) - 3; + memcpy(&gc, &grid_default_cell, sizeof gc); + gc.bg = colour; for (ptr = tim; *ptr != '\0'; ptr++) { if (*ptr >= '0' && *ptr <= '9') idx = *ptr - '0'; |