From 8c6f38407da11f32444ea2104fb78f8d1dfc1632 Mon Sep 17 00:00:00 2001 From: SpaghettiBorgar Date: Fri, 5 May 2023 06:25:16 +0200 Subject: [PATCH] fix clock position on first draw don't rely on box_x and box_y to position the clock, because it might not be initialized in the first frame. --- src/draw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/draw.c b/src/draw.c index 5870a48..42223a4 100644 --- a/src/draw.c +++ b/src/draw.c @@ -237,8 +237,8 @@ void draw_bigclock(struct term_buf* buf) if (!config.bigclock) return; - int xo = buf->box_x + buf->box_width / 2 - (5 * (CLOCK_W + 1)) / 2; - int yo = buf->box_y - CLOCK_H - 2; + int xo = buf->width / 2 - (5 * (CLOCK_W + 1)) / 2; + int yo = (buf->height - buf->box_height) / 2 - CLOCK_H - 2; char* clockstr = time_str("%H:%M", 6); struct tb_cell* clockcell;