From 9766fb13005b04669e60befd9e0e3cddf822ac1c Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 12 Aug 2009 16:02:23 +0100 Subject: [PATCH] [script] Fix Actor's ad-hoc parser ClutterActor parses positional and dimensional properties with a custom deserializer. We need to: - handle G_TYPE_INT64, the default integer type for JSON-GLib - use G_TYPE_FLOAT for properties, since Actor switched to it for the pixel-based ones This makes ClutterScript work again. --- clutter/clutter-actor.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 3071114b2..8b0d191a4 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -7164,9 +7164,9 @@ parse_units (ClutterActor *self, json_node_get_value (node, &value); - if (G_VALUE_HOLDS (&value, G_TYPE_INT)) + if (G_VALUE_HOLDS (&value, G_TYPE_INT64)) { - retval = (gfloat) g_value_get_int (&value); + retval = (gfloat) g_value_get_int64 (&value); } else if (G_VALUE_HOLDS (&value, G_TYPE_FLOAT)) { @@ -7432,8 +7432,8 @@ clutter_actor_parse_custom_node (ClutterScriptable *scriptable, units = parse_units (actor, dimension, node); /* convert back to pixels: all properties are pixel-based */ - g_value_init (value, G_TYPE_INT); - g_value_set_int (value, units); + g_value_init (value, G_TYPE_FLOAT); + g_value_set_float (value, units); retval = TRUE; }