clutter: Simplify clutter_state_change
clutter_state_get_animator now always returns NULL, because _set_animator is never called. https://gitlab.gnome.org/GNOME/mutter/merge_requests/452
This commit is contained in:
parent
73ce5b3a8d
commit
7f3fda6df6
@ -649,7 +649,6 @@ clutter_state_change (ClutterState *state,
|
|||||||
gboolean animate)
|
gboolean animate)
|
||||||
{
|
{
|
||||||
ClutterStatePrivate *priv;
|
ClutterStatePrivate *priv;
|
||||||
ClutterAnimator *animator;
|
|
||||||
State *new_state;
|
State *new_state;
|
||||||
guint duration;
|
guint duration;
|
||||||
GList *k;
|
GList *k;
|
||||||
@ -718,55 +717,37 @@ clutter_state_change (ClutterState *state,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
animator = clutter_state_get_animator (state,
|
for (k = new_state->keys; k != NULL; k = k->next)
|
||||||
priv->source_state_name,
|
|
||||||
priv->target_state_name);
|
|
||||||
priv->target_state = new_state;
|
|
||||||
|
|
||||||
if (animator == NULL && new_state->keys == NULL)
|
|
||||||
animator = clutter_state_get_animator (state, NULL,
|
|
||||||
priv->target_state_name);
|
|
||||||
|
|
||||||
if (animator != NULL)
|
|
||||||
{
|
{
|
||||||
/* we've got an animator overriding the tweened animation */
|
ClutterStateKey *key = k->data;
|
||||||
priv->current_animator = animator;
|
GValue initial = G_VALUE_INIT;
|
||||||
clutter_animator_set_timeline (animator, priv->timeline);
|
|
||||||
}
|
/* Reset the pre-pre-delay - this is only used for setting keys
|
||||||
else
|
* during transitions.
|
||||||
{
|
*/
|
||||||
for (k = new_state->keys; k != NULL; k = k->next)
|
key->pre_pre_delay = 0;
|
||||||
|
|
||||||
|
g_value_init (&initial, clutter_interval_get_value_type (key->interval));
|
||||||
|
|
||||||
|
if (key->is_animatable)
|
||||||
{
|
{
|
||||||
ClutterStateKey *key = k->data;
|
ClutterAnimatable *animatable;
|
||||||
GValue initial = G_VALUE_INIT;
|
|
||||||
|
|
||||||
/* Reset the pre-pre-delay - this is only used for setting keys
|
animatable = CLUTTER_ANIMATABLE (key->object);
|
||||||
* during transitions.
|
clutter_animatable_get_initial_state (animatable,
|
||||||
*/
|
key->property_name,
|
||||||
key->pre_pre_delay = 0;
|
&initial);
|
||||||
|
|
||||||
g_value_init (&initial, clutter_interval_get_value_type (key->interval));
|
|
||||||
|
|
||||||
if (key->is_animatable)
|
|
||||||
{
|
|
||||||
ClutterAnimatable *animatable;
|
|
||||||
|
|
||||||
animatable = CLUTTER_ANIMATABLE (key->object);
|
|
||||||
clutter_animatable_get_initial_state (animatable,
|
|
||||||
key->property_name,
|
|
||||||
&initial);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
g_object_get_property (key->object, key->property_name, &initial);
|
|
||||||
|
|
||||||
if (clutter_alpha_get_mode (key->alpha) != key->mode)
|
|
||||||
clutter_alpha_set_mode (key->alpha, key->mode);
|
|
||||||
|
|
||||||
clutter_interval_set_initial_value (key->interval, &initial);
|
|
||||||
clutter_interval_set_final_value (key->interval, &key->value);
|
|
||||||
|
|
||||||
g_value_unset (&initial);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
g_object_get_property (key->object, key->property_name, &initial);
|
||||||
|
|
||||||
|
if (clutter_alpha_get_mode (key->alpha) != key->mode)
|
||||||
|
clutter_alpha_set_mode (key->alpha, key->mode);
|
||||||
|
|
||||||
|
clutter_interval_set_initial_value (key->interval, &initial);
|
||||||
|
clutter_interval_set_final_value (key->interval, &key->value);
|
||||||
|
|
||||||
|
g_value_unset (&initial);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!animate)
|
if (!animate)
|
||||||
|
Loading…
Reference in New Issue
Block a user