From 3ce3867403baee81673e5a1ba05233be26d1bd2c Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 8 Jul 2018 16:52:33 +0200 Subject: [PATCH] gl: Don't accidentally use ints for float variables The int was floor()ing the x/y coordinates of glyphs, which could cause significant repositioning of glyphs when text was scaled via the MVP. --- gsk/gl/gskglrenderer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c index 76a54728de..718cc0965e 100644 --- a/gsk/gl/gskglrenderer.c +++ b/gsk/gl/gskglrenderer.c @@ -385,8 +385,8 @@ render_text_node (GskGLRenderer *self, guint num_glyphs = gsk_text_node_get_num_glyphs (node); int i; int x_position = 0; - int x = gsk_text_node_get_x (node) + builder->dx; - int y = gsk_text_node_get_y (node) + builder->dy; + float x = gsk_text_node_get_x (node) + builder->dx; + float y = gsk_text_node_get_y (node) + builder->dy; /* If the font has color glyphs, we don't need to recolor anything */ if (!force_color && font_has_color_glyphs (font)) @@ -405,7 +405,7 @@ render_text_node (GskGLRenderer *self, { const PangoGlyphInfo *gi = &glyphs[i]; const GskGLCachedGlyph *glyph; - int glyph_x, glyph_y, glyph_w, glyph_h; + float glyph_x, glyph_y, glyph_w, glyph_h; float tx, ty, tx2, ty2; double cx; double cy;