From 839f4b64941be2e4a6f1ec5325fe5ee8def11277 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 9 Jan 2023 12:01:46 -0700 Subject: [PATCH] [ft] Fix slanting clip box --- src/hb-ft-colr.hh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hb-ft-colr.hh b/src/hb-ft-colr.hh index d74837c4d..a5920abb7 100644 --- a/src/hb-ft-colr.hh +++ b/src/hb-ft-colr.hh @@ -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