From 25c2379d5f781ca05f784d9df25dd247d2193b71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 7 Jan 2021 17:19:43 +0100 Subject: [PATCH] box-drawing: x/y offsets: use pre-calculated offset values from term struct --- box-drawing.c | 14 ++------------ 1 file 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 = {