mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-04 07:15:29 -04:00
render: search: render colorized glyphs (emojis) correctly
This commit is contained in:
parent
d87160e5f6
commit
dca35215d0
1 changed files with 13 additions and 5 deletions
18
render.c
18
render.c
|
|
@ -2184,12 +2184,20 @@ render_search_box(struct terminal *term)
|
||||||
if (glyph == NULL)
|
if (glyph == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pixman_image_t *src = pixman_image_create_solid_fill(&fg);
|
if (unlikely(pixman_image_get_format(glyph->pix) == PIXMAN_a8r8g8b8)) {
|
||||||
pixman_image_composite32(
|
/* Glyph surface is a pre-rendered image (typically a color emoji...) */
|
||||||
PIXMAN_OP_OVER, src, glyph->pix, buf->pix[0], 0, 0, 0, 0,
|
pixman_image_composite32(
|
||||||
x + glyph->x, y + font_baseline(term) - glyph->y,
|
PIXMAN_OP_OVER, glyph->pix, NULL, buf->pix[0], 0, 0, 0, 0,
|
||||||
|
x + glyph->x, y + font_baseline(term) - glyph->y,
|
||||||
|
glyph->width, glyph->height);
|
||||||
|
} else {
|
||||||
|
pixman_image_t *src = pixman_image_create_solid_fill(&fg);
|
||||||
|
pixman_image_composite32(
|
||||||
|
PIXMAN_OP_OVER, src, glyph->pix, buf->pix[0], 0, 0, 0, 0,
|
||||||
|
x + glyph->x, y + font_baseline(term) - glyph->y,
|
||||||
glyph->width, glyph->height);
|
glyph->width, glyph->height);
|
||||||
pixman_image_unref(src);
|
pixman_image_unref(src);
|
||||||
|
}
|
||||||
|
|
||||||
x += term->cell_width;
|
x += term->cell_width;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue