Hi,

On Mon, Aug 18, 2008 at 1:24 PM, Nati B <[EMAIL PROTECTED]> wrote:
> maybe it has something to do with my overriding of the 'allocate' virtual
> method of the parent.

If you override this without chaining up everything will break badly;
you should probably consider overriding allocate an "advanced" thing
to do.

> So, what's the relation between the two - the change of position by the 
> animation and the 'allocate' call ? Do they interfere with each other or 
> built on top of each other ?

allocate() "implements" the change in position; if you set the
position, that sets where the actor asks to be, then later a layout
process runs which sets the actor to that position using allocate. It
doesn't really matter; you can just think of it as "setting position
moves the actor"; unless you override allocate, and then it breaks ;-)
but allocate should not be a thing you care about generally speaking.

One thing to consider, especially for fast/transient animations, is to
animate with anchor-x and anchor-y rather than x and y. The anchor
only affects painting, so is faster (avoids the relayout step).

The anchor feature of Clutter is just the "translate" part of an
affine transform, except it's backward (negative numbers are needed to
translate toward the bottom right). The transform made up of the
anchor, the scale, and the rotation is entirely a matter of how actors
are painted, so animating these properties will not result in
relayout. Anyway, if "anchor" were called "translate" it would be a
lot more intuitive imo.

> how should the composite actor delegate the allocate call to his children

When a parent actor is asked for its preferred size, it should ask its
children for their preferred size too. When a parent actor is
allocated, it then has to choose a policy to layout its children, and
allocate them accordingly (using their preferred size and the parent's
allocation as inputs to the algorithm).

The easiest thing though is to just subclass ClutterGroup and let it
implement allocate.

Havoc
-- 
To unsubscribe send a mail to [EMAIL PROTECTED]

Reply via email to