[gtk+/gtk-3-6] stylecontext: Always recompute font
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-6] stylecontext: Always recompute font
- Date: Wed, 5 Dec 2012 17:44:05 +0000 (UTC)
commit c3508c9fa3854a158c16da4b50e4cbcc321333b9
Author: Benjamin Otte <otte redhat com>
Date: Wed Dec 5 18:41:40 2012 +0100
stylecontext: Always recompute font
This is necessary because values in a GtkCssComputedValues can change
now. So if the font-size is inherited or animated, the cached value will
be outdated.
gtk/gtkstylecontext.c | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 9604c42..bcbea77 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -3519,15 +3519,12 @@ gtk_style_context_get_font (GtkStyleContext *context,
/* Yuck, fonts are created on-demand but we don't return a ref.
* Do bad things to achieve this requirement */
- description = g_object_get_data (G_OBJECT (data->store), "font-cache-for-get_font");
- if (description == NULL)
- {
- gtk_style_context_get (context, state, "font", &description, NULL);
- g_object_set_data_full (G_OBJECT (data->store),
- "font-cache-for-get_font",
- description,
- (GDestroyNotify) pango_font_description_free);
- }
+ gtk_style_context_get (context, state, "font", &description, NULL);
+ g_object_set_data_full (G_OBJECT (data->store),
+ "font-cache-for-get_font",
+ description,
+ (GDestroyNotify) pango_font_description_free);
+
return description;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]