actor: Make :allocation animatable
authorEmmanuele Bassi <ebassi@linux.intel.com>
Fri, 20 Apr 2012 17:06:02 +0000 (18:06 +0100)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Fri, 27 Apr 2012 11:30:49 +0000 (12:30 +0100)
commit8ef2c46baaa171f02824576f8a2ff0a7c2038581
tree8718601c27ebb21f61e9b7d96c211479de82f2fe
parent8cb9725699a2cc26844f1fce06eb3c6a6b218a6a
actor: Make :allocation animatable

Calling clutter_actor_allocate() should transition between the current
allocation and the new allocation, by using the defined implementation
of the easing state.

This means that:

  clutter_actor_save_easing_state (actor);
  clutter_actor_allocate (actor, &new_alloc, flags);
  clutter_actor_restore_easing_state (actor);

will cause "actor" to transition between the current allocation and the
desired new allocation.

The trick is to ensure that this happens without invalidating the
entire actor tree, but only the portion of the tree that has the
transitioned actor as the local root. For this reason, we just call the
allocate() implementation from within the transition frame advancement,
without invalidating flags: the actor, after all, *has* a valid
allocation for the duration of the transition.
clutter/clutter-actor.c