summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwrmr2025-10-08 19:53:41 -0400
committerwrmr2025-10-08 19:53:41 -0400
commitd408beff814b74f1d64ea181b6e653e937bd81ad (patch)
tree16f7e73f9795c4292a84cd1b5aa1759d4ae8c49b
parente9d374f44300f67d4f3974c043b0c0588bfdb869 (diff)
configurable pfp margin
-rw-r--r--main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/main.c b/main.c
index 0f3cf31..258aa9c 100644
--- a/main.c
+++ b/main.c
@@ -164,6 +164,7 @@ typedef struct {
struct {
int left, right, top, bottom;
int text_x, text_y;
+ int pfp;
} margin;
ColorOpt color[CPAIR_MAX];
} Options;
@@ -185,6 +186,7 @@ Options opt = {
.bottom = GFX_MARGIN_Y,
.text_x = GFX_TEXT_MARGIN_X,
.text_y = GFX_TEXT_MARGIN_Y,
+ .pfp = GFX_PFP_MARGIN,
},
.color = {
CPAIR_LIST(CPAIR_OPT_X)
@@ -507,7 +509,7 @@ typedef struct {
int post_left_margin(Post *post) {
int lm = opt.margin.left;
- if (opt.post.pfp) lm += post->user->pfp.cols + GFX_PFP_MARGIN;
+ if (opt.post.pfp) lm += post->user->pfp.cols + opt.margin.pfp;
return lm;
}
@@ -652,7 +654,7 @@ void gfx_draw_post(GfxPost *post, int y, int x, int width, Arena *scratch) {
if (height > h) pfpy += (height - h) >> 1;
gfx_draw_pic(pfp,
pfpy,
- left - GFX_PFP_MARGIN,
+ left - opt.margin.pfp,
GFX_PFP_MAX_LINES,
GFX_PFP_MAX_COLS,
PIC_LEFT);
@@ -977,6 +979,7 @@ int sect_margin(Str k, Str v, Arena *perm) {
PROP_INT("bottom", &opt.margin.bottom);
PROP_INT("text.x", &opt.margin.text_x);
PROP_INT("text.y", &opt.margin.text_y);
+ PROP_INT("pfp", &opt.margin.pfp);
return -1;
}