mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-17 22:05:22 -05:00
add setting for strikeout thickness
This commit is contained in:
parent
01fa59b6b7
commit
b47a4dd255
6 changed files with 32 additions and 2 deletions
14
render.c
14
render.c
|
|
@ -544,11 +544,21 @@ draw_strikeout(const struct terminal *term, pixman_image_t *pix,
|
|||
const struct fcft_font *font,
|
||||
const pixman_color_t *color, int x, int y, int cols)
|
||||
{
|
||||
const int thickness = term->conf->strikeout_thickness.px >= 0
|
||||
? term_pt_or_px_as_pixels(
|
||||
term, &term->conf->strikeout_thickness)
|
||||
: font->strikeout.thickness;
|
||||
|
||||
/* Try to center custom strikeout */
|
||||
const int position = term->conf->strikeout_thickness.px >= 0
|
||||
? font->strikeout.position - round(font->strikeout.thickness / 2.) + round(thickness / 2.)
|
||||
: font->strikeout.position;
|
||||
|
||||
pixman_image_fill_rectangles(
|
||||
PIXMAN_OP_SRC, pix, color,
|
||||
1, &(pixman_rectangle16_t){
|
||||
x, y + term->font_baseline - font->strikeout.position,
|
||||
cols * term->cell_width, font->strikeout.thickness});
|
||||
x, y + term->font_baseline - position,
|
||||
cols * term->cell_width, thickness});
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue