mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-06 01:40:22 -05:00
font: never set glyph->cols to something that is less than 0
This commit is contained in:
parent
88c1a8939f
commit
8274e3e034
1 changed files with 4 additions and 1 deletions
5
font.c
5
font.c
|
|
@ -648,10 +648,13 @@ glyph_for_wchar(const struct font *font, wchar_t wc, struct glyph *glyph)
|
|||
pixman_image_set_filter(pix, PIXMAN_FILTER_BEST, NULL, 0);
|
||||
}
|
||||
|
||||
int cols = wcwidth(wc);
|
||||
if (cols < 0)
|
||||
cols = 0;
|
||||
|
||||
*glyph = (struct glyph){
|
||||
.wc = wc,
|
||||
.cols = wcwidth(wc),
|
||||
.cols = cols,
|
||||
.pix = pix,
|
||||
.x = font->face->glyph->bitmap_left * font->pixel_size_fixup,
|
||||
.y = font->face->glyph->bitmap_top * font->pixel_size_fixup,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue