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.
This commit is contained in:
SpaghettiBorgar 2023-05-05 06:25:16 +02:00
parent 2cbd825b25
commit 8c6f38407d
1 changed files with 2 additions and 2 deletions

View File

@ -237,8 +237,8 @@ void draw_bigclock(struct term_buf* buf)
if (!config.bigclock) if (!config.bigclock)
return; return;
int xo = buf->box_x + buf->box_width / 2 - (5 * (CLOCK_W + 1)) / 2; int xo = buf->width / 2 - (5 * (CLOCK_W + 1)) / 2;
int yo = buf->box_y - CLOCK_H - 2; int yo = (buf->height - buf->box_height) / 2 - CLOCK_H - 2;
char* clockstr = time_str("%H:%M", 6); char* clockstr = time_str("%H:%M", 6);
struct tb_cell* clockcell; struct tb_cell* clockcell;