summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/main.c b/main.c
index a307ae9..17e0416 100644
--- a/main.c
+++ b/main.c
@@ -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;