diff options
| author | wrmr | 2025-11-09 22:00:15 -0500 |
|---|---|---|
| committer | wrmr | 2025-11-09 22:00:15 -0500 |
| commit | 3a4785406d515d83655779788f6cce6cfb3ec6d7 (patch) | |
| tree | 45aeb28c438f3a1f65af29a9c32ef6e205544598 /main.c | |
| parent | 2ccfe5af5bae0efba4a08310aff27e19e7f7b5d4 (diff) | |
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -876,6 +876,7 @@ void gfx_draw(Gfx *gfx, int cur, Arena *scratch) { void gfx_draw_user(User *user, Arena *scratch) { int cy = getmaxy(stdscr) >> 1, cx = getmaxx(stdscr) >> 1; + int pfpcols = MIN(user->pfp.cols, GFX_PFP_MAX_COLS); const char *binks = cstr_fmt(scratch, "%u binks", user->post_count); int box_height = 3 + opt.margin.text_y; @@ -885,7 +886,7 @@ void gfx_draw_user(User *user, Arena *scratch) { int bw = MIN(user->banner.cols, getmaxx(stdscr) - opt.margin.text_x * 2 - 4); int total_height = (bh ? bh + 1 : 0) + MAX(box_height, user->pfp.lines) + opt.margin.text_y * 2; - int total_width = MAX(bw, user->pfp.cols + 2 + box_width) + opt.margin.text_x * 2; + int total_width = MAX(bw, pfpcols + 2 + box_width) + opt.margin.text_x * 2; gfx_cleared_box(cy - (total_height >> 1) - 2 - opt.margin.text_y, cx - (total_width >> 1) - 2 - opt.margin.text_x, total_height + 4, total_width + 4); @@ -898,7 +899,7 @@ void gfx_draw_user(User *user, Arena *scratch) { int left = cx - (total_width >> 1); - if (bw > box_width + user->pfp.cols) left += (bw - box_width - user->pfp.cols) >> 1; + if (bw > box_width + pfpcols) left += (bw - box_width - pfpcols) >> 1; use_color(CPAIR_PFP); int pfpy = cy; @@ -907,7 +908,7 @@ void gfx_draw_user(User *user, Arena *scratch) { } gfx_draw_pic(&user->pfp, pfpy, left, GFX_PFP_MAX_LINES, GFX_PFP_MAX_COLS, 0); use_color(CPAIR_USER); - left += user->pfp.cols + 2; + left += pfpcols + 2; if (user->pfp.lines > box_height) { cy += (user->pfp.lines - box_height) >> 1; |
