animator: handle no initial key
Fixing the crasher reported in bug #1995.
This commit is contained in:
parent
d2db512788
commit
3bc0672fef
@ -457,8 +457,9 @@ animation_animator_ensure_animator (ClutterAnimator *animator,
|
|||||||
initial = g_list_find_custom (key_animator->current->next,
|
initial = g_list_find_custom (key_animator->current->next,
|
||||||
key,
|
key,
|
||||||
sort_actor_prop_func);
|
sort_actor_prop_func);
|
||||||
g_assert (initial != NULL);
|
|
||||||
|
|
||||||
|
if (initial)
|
||||||
|
{
|
||||||
initial_key = initial->data;
|
initial_key = initial->data;
|
||||||
|
|
||||||
clutter_interval_set_initial_value (key_animator->interval,
|
clutter_interval_set_initial_value (key_animator->interval,
|
||||||
@ -488,6 +489,16 @@ animation_animator_ensure_animator (ClutterAnimator *animator,
|
|||||||
if ((clutter_alpha_get_mode (key_animator->alpha) != next_key->mode))
|
if ((clutter_alpha_get_mode (key_animator->alpha) != next_key->mode))
|
||||||
clutter_alpha_set_mode (key_animator->alpha, next_key->mode);
|
clutter_alpha_set_mode (key_animator->alpha, next_key->mode);
|
||||||
}
|
}
|
||||||
|
else /* no relevant interval */
|
||||||
|
{
|
||||||
|
ClutterAnimatorKey *current_key = key_animator->current->data;
|
||||||
|
clutter_interval_set_initial_value (key_animator->interval,
|
||||||
|
¤t_key->value);
|
||||||
|
clutter_interval_set_final_value (key_animator->interval,
|
||||||
|
¤t_key->value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (progress < key_animator->start)
|
else if (progress < key_animator->start)
|
||||||
{
|
{
|
||||||
@ -500,8 +511,9 @@ animation_animator_ensure_animator (ClutterAnimator *animator,
|
|||||||
initial = list_find_custom_reverse (key_animator->current->prev,
|
initial = list_find_custom_reverse (key_animator->current->prev,
|
||||||
key,
|
key,
|
||||||
sort_actor_prop_func);
|
sort_actor_prop_func);
|
||||||
g_assert (initial != NULL);
|
|
||||||
|
|
||||||
|
if (initial)
|
||||||
|
{
|
||||||
initial_key = initial->data;
|
initial_key = initial->data;
|
||||||
|
|
||||||
clutter_interval_set_initial_value (key_animator->interval,
|
clutter_interval_set_initial_value (key_animator->interval,
|
||||||
@ -528,6 +540,16 @@ animation_animator_ensure_animator (ClutterAnimator *animator,
|
|||||||
if ((clutter_alpha_get_mode (key_animator->alpha) != next_key->mode))
|
if ((clutter_alpha_get_mode (key_animator->alpha) != next_key->mode))
|
||||||
clutter_alpha_set_mode (key_animator->alpha, next_key->mode);
|
clutter_alpha_set_mode (key_animator->alpha, next_key->mode);
|
||||||
}
|
}
|
||||||
|
else /* no relevant interval */
|
||||||
|
{
|
||||||
|
ClutterAnimatorKey *current_key = key_animator->current->data;
|
||||||
|
clutter_interval_set_initial_value (key_animator->interval,
|
||||||
|
¤t_key->value);
|
||||||
|
clutter_interval_set_final_value (key_animator->interval,
|
||||||
|
¤t_key->value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user