vulkan/glyphcache: Add padding around ink rect
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Wed, 22 Mar 2023 01:06:04 +0000 (22:06 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Thu, 30 Mar 2023 20:13:35 +0000 (17:13 -0300)
This is what the GL renderer does, and it gets rid of the cutout
characters.

gsk/vulkan/gskvulkanglyphcache.c

index f1adefafca61a623fafb6ebc1edb2ff8e3a6f32f..e44aa4ab7a3c2184ca91299b0f422dcbc04fcf37 100644 (file)
@@ -381,6 +381,11 @@ gsk_vulkan_glyph_cache_lookup (GskVulkanGlyphCache *cache,
       pango_font_get_glyph_extents (font, glyph, &ink_rect, NULL);
       pango_extents_to_pixels (&ink_rect, NULL);
 
+      ink_rect.x -= 1;
+      ink_rect.y -= 1;
+      ink_rect.width += 2;
+      ink_rect.height += 2;
+
       value->draw_x = ink_rect.x;
       value->draw_y = ink_rect.y;
       value->draw_width = ink_rect.width;