summaryrefslogtreecommitdiff
path: root/pango/pango-attributes.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-07-05 20:56:02 -0400
committerMatthias Clasen <mclasen@redhat.com>2019-07-11 11:42:38 -0400
commitf41932c5c5155a1ac3bedebdceb95603de95c919 (patch)
treeb04bd5ae9c0cdd44389a3325bbad431368929e87 /pango/pango-attributes.c
parent482c7d75ec0b228dffc4c8522a3b8666cc5aff61 (diff)
downloadpango-f41932c5c5155a1ac3bedebdceb95603de95c919.tar.gz
Support size as percentage in markupmarkup-percentage
Test included. Closes https://gitlab.gnome.org/GNOME/pango/issues/23
Diffstat (limited to 'pango/pango-attributes.c')
-rw-r--r--pango/pango-attributes.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c
index 85e5a240..af4289ee 100644
--- a/pango/pango-attributes.c
+++ b/pango/pango-attributes.c
@@ -1901,8 +1901,7 @@ pango_attr_iterator_get_font (PangoAttrIterator *iterator,
PangoFontMask mask = 0;
gboolean have_language = FALSE;
- gdouble scale = 0;
- gboolean have_scale = FALSE;
+ double scale = 1.0;
g_return_if_fail (iterator != NULL);
g_return_if_fail (desc != NULL);
@@ -1980,10 +1979,9 @@ pango_attr_iterator_get_font (PangoAttrIterator *iterator,
}
break;
case PANGO_ATTR_SCALE:
- if (!have_scale)
+ if (!(mask & PANGO_FONT_MASK_SIZE))
{
- have_scale = TRUE;
- scale = ((PangoAttrFloat *)attr)->value;
+ scale *= ((PangoAttrFloat *)attr)->value;
}
break;
case PANGO_ATTR_LANGUAGE:
@@ -2024,7 +2022,7 @@ pango_attr_iterator_get_font (PangoAttrIterator *iterator,
}
}
- if (have_scale)
+ if (scale != 1.0)
{
if (pango_font_description_get_size_is_absolute (desc))
pango_font_description_set_absolute_size (desc, scale * pango_font_description_get_size (desc));