summaryrefslogtreecommitdiff
path: root/gsk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-09-17 13:17:53 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-09-17 13:38:29 -0400
commitd962360fa0e218d0e9f6f48b214a2428cb730464 (patch)
treefd7939a71fe1f068d5461813a473e7eaa13fee57 /gsk
parent87af45403ace1047b91ddbab98d9d5a5e15b84eb (diff)
downloadgtk+-d962360fa0e218d0e9f6f48b214a2428cb730464.tar.gz
Fix glyph cache entry sizing
The subpixel-positioned glyph extends on both sides.
Diffstat (limited to 'gsk')
-rw-r--r--gsk/ngl/gsknglglyphlibrary.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gsk/ngl/gsknglglyphlibrary.c b/gsk/ngl/gsknglglyphlibrary.c
index 8ddf1ab265..9c184ed0f7 100644
--- a/gsk/ngl/gsknglglyphlibrary.c
+++ b/gsk/ngl/gsknglglyphlibrary.c
@@ -290,9 +290,15 @@ gsk_ngl_glyph_library_add (GskNglGlyphLibrary *self,
pango_extents_to_pixels (&ink_rect, NULL);
if (key->xshift != 0)
- ink_rect.width++;
+ {
+ ink_rect.x -= 1;
+ ink_rect.width += 2;
+ }
if (key->yshift != 0)
- ink_rect.height++;
+ {
+ ink_rect.y -= 1;
+ ink_rect.height += 2;
+ }
width = (int) ceil (ink_rect.width * key->scale / 1024.0);
height = (int) ceil (ink_rect.height * key->scale / 1024.0);