[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.
This commit is contained in:
Emmanuele Bassi 2009-08-12 16:02:23 +01:00
parent cfbbacb807
commit 9766fb1300

View File

@ -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;
}