[gtk/wip/otte/for-master: 1/2] rendernodeparser: Don't use %g when writing file




commit 5470a1344d70cd5efef8512826fc3cd9ac6b6a61
Author: Benjamin Otte <otte redhat com>
Date:   Wed Jul 14 20:18:44 2021 +0200

    rendernodeparser: Don't use %g when writing file
    
    %g is locale dependent and can add "," where "." should be. Use
    string_append_double() instead.

 gsk/gskrendernodeparser.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gsk/gskrendernodeparser.c b/gsk/gskrendernodeparser.c
index a8b13c39fe..af25763fec 100644
--- a/gsk/gskrendernodeparser.c
+++ b/gsk/gskrendernodeparser.c
@@ -2375,16 +2375,16 @@ gsk_text_node_serialize_glyphs (GskRenderNode *node,
           g_string_set_size (str, 0);
         }
 
-      g_string_append_printf (p, "%u %g",
-                              glyphs[i].glyph,
-                              (double) glyphs[i].geometry.width / PANGO_SCALE);
+      g_string_append_printf (p, "%u ", glyphs[i].glyph);
+      string_append_double (p, (double) glyphs[i].geometry.width / PANGO_SCALE);
       if (!glyphs[i].attr.is_cluster_start ||
           glyphs[i].geometry.x_offset != 0 ||
           glyphs[i].geometry.y_offset != 0)
         {
-          g_string_append_printf (p, " %g %g",
-                                  (double) glyphs[i].geometry.x_offset / PANGO_SCALE,
-                                  (double) glyphs[i].geometry.y_offset / PANGO_SCALE);
+          g_string_append (p, " ");
+          string_append_double (p, (double) glyphs[i].geometry.x_offset / PANGO_SCALE);
+          g_string_append (p, " ");
+          string_append_double (p, (double) glyphs[i].geometry.y_offset / PANGO_SCALE);
           if (!glyphs[i].attr.is_cluster_start)
             g_string_append (p, " same-cluster");
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]