[ft] Fix slanting clip box

This commit is contained in:
Behdad Esfahbod 2023-01-09 12:01:46 -07:00
parent 30adbc22d9
commit 839f4b6494
1 changed files with 6 additions and 2 deletions

View File

@ -447,9 +447,13 @@ hb_ft_paint_glyph_colr (hb_font_t *font,
if (FT_Get_Color_Glyph_ClipBox (ft_face, gid, &clip_box))
{
c.funcs->push_clip_rectangle (c.data,
clip_box.bottom_left.x - roundf (font->slant_xy * clip_box.bottom_left.y),
clip_box.bottom_left.x +
roundf (hb_min (font->slant_xy * clip_box.bottom_left.y,
font->slant_xy * clip_box.top_left.y)),
clip_box.bottom_left.y,
clip_box.top_right.x - roundf (font->slant_xy * clip_box.top_right.y),
clip_box.top_right.x +
roundf (hb_max (font->slant_xy * clip_box.bottom_right.y,
font->slant_xy * clip_box.top_right.y)),
clip_box.top_right.y);
}
else