Skip to content

Commit

Permalink
css: Fix case where we didn't convert pt => px
Browse files Browse the repository at this point in the history
Fixes gtk_widget_override_font() not behaving properly since commit
df08fc9.

https://bugzilla.gnome.org/show_bug.cgi?id=768902
  • Loading branch information
Benjamin Otte committed Jul 28, 2016
1 parent f422208 commit 5ccc0e4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gtk/gtkcssshorthandpropertyimpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5ccc0e4

Please sign in to comment.