summaryrefslogtreecommitdiff
path: root/pango/pango-attributes.c
diff options
context:
space:
mode:
Diffstat (limited to 'pango/pango-attributes.c')
-rw-r--r--pango/pango-attributes.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c
index fd0df205..26d08404 100644
--- a/pango/pango-attributes.c
+++ b/pango/pango-attributes.c
@@ -2382,10 +2382,16 @@ pango_attr_iterator_get_font (PangoAttrIterator *iterator,
if (have_scale)
{
+ /* We need to use a local variable to ensure that the compiler won't
+ * implicitly cast it to integer while the result is kept in registers,
+ * leading to a wrong approximation in i386 (with 387 FPU)
+ */
+ volatile double size = scale * pango_font_description_get_size (desc);
+
if (pango_font_description_get_size_is_absolute (desc))
- pango_font_description_set_absolute_size (desc, scale * pango_font_description_get_size (desc));
+ pango_font_description_set_absolute_size (desc, size);
else
- pango_font_description_set_size (desc, scale * pango_font_description_get_size (desc));
+ pango_font_description_set_size (desc, size);
}
}