state: Fix the usage of ClutterAnimator in ClutterScript
Fix the transition parser to allow transitions that have only an animator and no keys defined. http://bugzilla.clutter-project.org/show_bug.cgi?id=2325
This commit is contained in:
parent
2d41d5afcb
commit
172fc6bfed
@ -1758,21 +1758,12 @@ parse_state_transition (JsonArray *array,
|
|||||||
|
|
||||||
if (!json_object_has_member (object, "source") ||
|
if (!json_object_has_member (object, "source") ||
|
||||||
!json_object_has_member (object, "target") ||
|
!json_object_has_member (object, "target") ||
|
||||||
!json_object_has_member (object, "keys"))
|
!(json_object_has_member (object, "keys") ||
|
||||||
|
json_object_has_member (object, "animator")))
|
||||||
{
|
{
|
||||||
g_warning ("The transition description at index %d is missing one "
|
g_warning ("The transition description at index %d is missing one "
|
||||||
"of the mandatory members: source, target and keys",
|
"of the mandatory members: source, target and keys or "
|
||||||
index_);
|
"animator", index_);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
keys = json_object_get_array_member (object, "keys");
|
|
||||||
if (keys == NULL)
|
|
||||||
{
|
|
||||||
g_warning ("The transition description at index %d has an invalid "
|
|
||||||
"key member of type '%s' when an array was expected.",
|
|
||||||
index_,
|
|
||||||
json_node_type_name (json_object_get_member (object, "keys")));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1809,6 +1800,19 @@ parse_state_transition (JsonArray *array,
|
|||||||
CLUTTER_ANIMATOR (animator));
|
CLUTTER_ANIMATOR (animator));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!json_object_has_member (object, "keys"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
keys = json_object_get_array_member (object, "keys");
|
||||||
|
if (keys == NULL && !json_object_has_member (object, "animator"))
|
||||||
|
{
|
||||||
|
g_warning ("The transition description at index %d has an invalid "
|
||||||
|
"key member of type '%s' when an array was expected.",
|
||||||
|
index_,
|
||||||
|
json_node_type_name (json_object_get_member (object, "keys")));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (G_IS_VALUE (clos->value))
|
if (G_IS_VALUE (clos->value))
|
||||||
valid_keys = g_slist_reverse (g_value_get_pointer (clos->value));
|
valid_keys = g_slist_reverse (g_value_get_pointer (clos->value));
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user