summaryrefslogtreecommitdiff
path: root/gtk/gtkcssstyleproperty.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/gtkcssstyleproperty.c')
-rw-r--r--gtk/gtkcssstyleproperty.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gtk/gtkcssstyleproperty.c b/gtk/gtkcssstyleproperty.c
index ad713ec422..6e4f23a2e3 100644
--- a/gtk/gtkcssstyleproperty.c
+++ b/gtk/gtkcssstyleproperty.c
@@ -28,10 +28,16 @@
#include "gtkprivatetypebuiltins.h"
#include "gtkstylepropertiesprivate.h"
+#include <math.h>
#include <cairo-gobject.h>
#include "gtkcssimagegradientprivate.h"
#include "gtkcssimageprivate.h"
+/* this is in case round() is not provided by the compiler,
+ * such as in the case of C89 compilers, like MSVC
+ */
+#include "fallback-c89.c"
+
enum {
PROP_0,
PROP_ID,
@@ -165,6 +171,10 @@ _gtk_css_style_property_query (GtkStyleProperty *property,
g_value_take_boxed (value, pattern);
}
}
+ else if (G_VALUE_TYPE (val) == GTK_TYPE_CSS_NUMBER)
+ {
+ g_value_set_int (value, round (_gtk_css_number_get (g_value_get_boxed (val), 100)));
+ }
else
g_value_copy (val, value);
}