[gtk+] css: Fix case where we didn't convert pt => px



commit 5ccc0e40f5eaa9c0e2121674913c398e9963f0be
Author: Benjamin Otte <otte redhat com>
Date:   Thu Jul 28 11:41:21 2016 -0400

    css: Fix case where we didn't convert pt => px
    
    Fixes gtk_widget_override_font() not behaving properly since commit
    df08fc91bdc1d2e4c866122304fabe4dd298a7de.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=768902

 gtk/gtkcssshorthandpropertyimpl.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcssshorthandpropertyimpl.c b/gtk/gtkcssshorthandpropertyimpl.c
index bd60587..3931363 100644
--- a/gtk/gtkcssshorthandpropertyimpl.c
+++ b/gtk/gtkcssshorthandpropertyimpl.c
@@ -1113,9 +1113,13 @@ unpack_font_description (GtkCssShorthandProperty *shorthand,
 
   if (mask & PANGO_FONT_MASK_SIZE)
     {
-      g_value_init (&v, G_TYPE_DOUBLE);
-      g_value_set_double (&v, (double) pango_font_description_get_size (description) / PANGO_SCALE);
+      double size;
 
+      g_value_init (&v, G_TYPE_DOUBLE);
+      size = pango_font_description_get_size (description) / PANGO_SCALE;
+      if (!pango_font_description_get_size_is_absolute (description))
+        size = size * 96.0 / 72.0;
+      g_value_set_double (&v, size);
       prop = _gtk_style_property_lookup ("font-size");
       _gtk_style_property_assign (prop, props, state, &v);
       g_value_unset (&v);


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