keyframe-transition: Create a new interval if necessary

When setting up the transition manually by calling

  clutter_keyframe_transition_set_key_frame (transition, n, keys);
  clutter_keyframe_transition_set_values (transition, n, values);
  clutter_keyframe_transition_set_modes (transition, n, modes);

the frame doesn't have a valid interval when calling set_keys(), so we
need to check its existence and create it if necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=676031
This commit is contained in:
Bastian Winkler 2012-05-14 16:32:53 +02:00
parent 8a4489c48e
commit 0ef4cc3aed

View File

@ -493,7 +493,12 @@ clutter_keyframe_transition_set_values (ClutterKeyframeTransition *transition,
{ {
KeyFrame *frame = &g_array_index (priv->frames, KeyFrame, i); KeyFrame *frame = &g_array_index (priv->frames, KeyFrame, i);
if (frame->interval)
clutter_interval_set_final_value (frame->interval, &values[i]); clutter_interval_set_final_value (frame->interval, &values[i]);
else
frame->interval =
clutter_interval_new_with_values (G_VALUE_TYPE (&values[i]), NULL,
&values[i]);
} }
} }