mirror of https://github.com/fairyglade/ly.git
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:
parent
2cbd825b25
commit
8c6f38407d
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue