gsk/vulkanglyphcache: Cleanup maths
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Thu, 23 Mar 2023 02:45:09 +0000 (23:45 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Thu, 30 Mar 2023 20:13:35 +0000 (17:13 -0300)
A trivial cleanup to match what the GL renderer does

gsk/vulkan/gskvulkanglyphcache.c

index e44aa4ab7a3c2184ca91299b0f422dcbc04fcf37..15db38d9aa3c63614d84fd69214722828a6d6ee5 100644 (file)
@@ -270,11 +270,8 @@ render_glyph (Atlas          *atlas,
 
   gi.glyph = key->glyph;
   gi.geometry.width = value->draw_width * 1024;
-  if (key->glyph & PANGO_GLYPH_UNKNOWN_FLAG)
-    gi.geometry.x_offset = key->xshift * 256;
-  else
-    gi.geometry.x_offset = key->xshift * 256 - value->draw_x * 1024;
-  gi.geometry.y_offset = key->yshift * 256 - value->draw_y * 1024;
+  gi.geometry.x_offset = (0.25 * key->xshift - value->draw_x) * 1024;
+  gi.geometry.y_offset = (0.25 * key->yshift - value->draw_y) * 1024;
 
   glyphs.num_glyphs = 1;
   glyphs.glyphs = &gi;