[gtk/css-font-values: 2/3] css: Simplify compute for font variations
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/css-font-values: 2/3] css: Simplify compute for font variations
- Date: Fri, 10 Jan 2020 22:29:03 +0000 (UTC)
commit 99aa47185ea2cc90f62b318d14e2a19a2abc07a3
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jan 10 01:36:23 2020 -0500
css: Simplify compute for font variations
Just like font features, font variations are stored
as a hash table mapping strings to pure number values,
which never change during compute.
gtk/gtkcssfontvariationsvalue.c | 24 +-----------------------
1 file changed, 1 insertion(+), 23 deletions(-)
---
diff --git a/gtk/gtkcssfontvariationsvalue.c b/gtk/gtkcssfontvariationsvalue.c
index ed6dfd8e3b..e15a8c715b 100644
--- a/gtk/gtkcssfontvariationsvalue.c
+++ b/gtk/gtkcssfontvariationsvalue.c
@@ -56,29 +56,7 @@ gtk_css_value_font_variations_compute (GtkCssValue *specified,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{
- GHashTableIter iter;
- gpointer name, coord;
- GtkCssValue *computed_coord;
- GtkCssValue *result;
- gboolean changes = FALSE;
-
- result = gtk_css_font_variations_value_new_empty ();
-
- g_hash_table_iter_init (&iter, specified->axes);
- while (g_hash_table_iter_next (&iter, &name, &coord))
- {
- computed_coord = _gtk_css_value_compute (coord, property_id, provider, style, parent_style);
- changes |= computed_coord != coord;
- gtk_css_font_variations_value_add_axis (result, name, computed_coord);
- }
-
- if (!changes)
- {
- _gtk_css_value_unref (result);
- result = _gtk_css_value_ref (specified);
- }
-
- return result;
+ return _gtk_css_value_ref (specified);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]