aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-01-07 16:19:43 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-01-11 08:31:09 +0000
commit25c2379d5f781ca05f784d9df25dd247d2193b71 (patch)
tree88f3258884c79dcd96b75a1c193c454549b5ea09
parentterm: use pt_or_px_as_pixels() (diff)
box-drawing: x/y offsets: use pre-calculated offset values from term struct
-rw-r--r--box-drawing.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/box-drawing.c b/box-drawing.c
index 6bfaef82..7ec7be09 100644
--- a/box-drawing.c
+++ b/box-drawing.c
@@ -2064,23 +2064,13 @@ box_drawing(const struct terminal *term, wchar_t wc)
};
draw_glyph(wc, &buf);
- const struct config *conf = term->conf;
-
- int x_ofs = conf->horizontal_letter_offset.px > 0
- ? conf->horizontal_letter_offset.px
- : conf->horizontal_letter_offset.pt * term->font_dpi / 72.;
- int y_ofs = conf->vertical_letter_offset.px > 0
- ? conf->vertical_letter_offset.px
- : conf->vertical_letter_offset.pt * term->font_dpi / 72.;
-
-
struct fcft_glyph *glyph = xmalloc(sizeof(*glyph));
*glyph = (struct fcft_glyph){
.wc = wc,
.cols = 1,
.pix = pix,
- .x = -x_ofs,
- .y = y_ofs + term->fonts[0]->ascent,
+ .x = -term->font_x_ofs,
+ .y = term->font_y_ofs + term->fonts[0]->ascent,
.width = width,
.height = height,
.advance = {