mirror of
https://github.com/brl/mutter.git
synced 2025-01-11 20:22:23 +00:00
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") ||
|
||||
!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 "
|
||||
"of the mandatory members: source, target and keys",
|
||||
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")));
|
||||
"of the mandatory members: source, target and keys or "
|
||||
"animator", index_);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1809,6 +1800,19 @@ parse_state_transition (JsonArray *array,
|
||||
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))
|
||||
valid_keys = g_slist_reverse (g_value_get_pointer (clos->value));
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user