mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-28 07:58:00 -04:00
box-drawing: x/y offsets: use pre-calculated offset values from term struct
This commit is contained in:
parent
1830dfca55
commit
25c2379d5f
1 changed files with 2 additions and 12 deletions
|
|
@ -2064,23 +2064,13 @@ box_drawing(const struct terminal *term, wchar_t wc)
|
||||||
};
|
};
|
||||||
draw_glyph(wc, &buf);
|
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));
|
struct fcft_glyph *glyph = xmalloc(sizeof(*glyph));
|
||||||
*glyph = (struct fcft_glyph){
|
*glyph = (struct fcft_glyph){
|
||||||
.wc = wc,
|
.wc = wc,
|
||||||
.cols = 1,
|
.cols = 1,
|
||||||
.pix = pix,
|
.pix = pix,
|
||||||
.x = -x_ofs,
|
.x = -term->font_x_ofs,
|
||||||
.y = y_ofs + term->fonts[0]->ascent,
|
.y = term->font_y_ofs + term->fonts[0]->ascent,
|
||||||
.width = width,
|
.width = width,
|
||||||
.height = height,
|
.height = height,
|
||||||
.advance = {
|
.advance = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue