From: Georges Basile Stavracas Neto Date: Sat, 1 Apr 2023 19:09:06 +0000 (-0300) Subject: gsk/vulkan/glyphcache: Ceil glyph surface size X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~446^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=56c643306ae4771df9ee5ac6befe7f932aa22783;p=gtk4.git gsk/vulkan/glyphcache: Ceil glyph surface size This is what GL does, and for a reason: it can lead to width or height for very small glyphs. Also, switch to dividing by a float (1024.0) instead of an integer (1024). --- diff --git a/gsk/vulkan/gskvulkanglyphcache.c b/gsk/vulkan/gskvulkanglyphcache.c index 15db38d9aa..ab623b9445 100644 --- a/gsk/vulkan/gskvulkanglyphcache.c +++ b/gsk/vulkan/gskvulkanglyphcache.c @@ -261,8 +261,8 @@ render_glyph (Atlas *atlas, PangoGlyphInfo gi; surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, - value->draw_width * key->scale / 1024, - value->draw_height * key->scale / 1024); + ceil (value->draw_width * key->scale / 1024.0), + ceil (value->draw_height * key->scale / 1024.0)); cairo_surface_set_device_scale (surface, key->scale / 1024.0, key->scale / 1024.0); cr = cairo_create (surface);