projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d9a602f
)
Deal with non-multiple-of-100 font weights
author
Matthias Clasen
<mclasen@redhat.com>
Fri, 1 Jun 2012 20:15:16 +0000
(16:15 -0400)
committer
Matthias Clasen
<mclasen@redhat.com>
Fri, 1 Jun 2012 20:15:16 +0000
(16:15 -0400)
We should not run into an assertion so easily.
gtk/gtkcssenumvalue.c
patch
|
blob
|
history
diff --git
a/gtk/gtkcssenumvalue.c
b/gtk/gtkcssenumvalue.c
index 84e986b4149adf139a7857522ffe9469f0d579d3..56fb1e829f823cdc9b130e26edc9678196fe6685 100644
(file)
--- a/
gtk/gtkcssenumvalue.c
+++ b/
gtk/gtkcssenumvalue.c
@@
-229,10
+229,13
@@
GtkCssValue *
_gtk_css_font_weight_value_new (PangoWeight font_weight)
{
guint i;
+ gint w;
+
+ w = ((font_weight + 50) / 100) * 100;
for (i = 0; i < G_N_ELEMENTS (font_weight_values); i++)
{
- if (font_weight_values[i].value ==
font_weight
)
+ if (font_weight_values[i].value ==
w
)
return _gtk_css_value_ref (&font_weight_values[i]);
}