Jaap A. Haitsma wrote:
> On Dec 28, 2007 9:35 PM, Jaap A. Haitsma <[EMAIL PROTECTED]> wrote:
> I think I figured out what's causing most of these problems.
> clutter_actor_scale behaves differently in 0.5. If you look at the
> test test-scale you see that in 0.4 all the scaling is being done from
> the top-right corner while in 0.5 it's done from the top left corner.
> I guess this probably has to do with anchor_point API addition to 0.5.
> I've attached a patch for foofone of clutter-toys. If you press a
> button the button moves when it gets scaled.
> 
> Any idea what needs to be done to get the 0.4 applications that use
> scaling  to work again correctly under 0.5?

The way that gravity is done in 0.5 has completely changed. In 0.4
gravity was handled by directly adjusting the position of the actor,
which did not work very well; for example, if you scaled with
GRAVITY_CENTER, and then called_clutter_actor_set_position() this undid
the centering (and there were some other issues).

In 0.5 we have basically did away with scaling with gravity, and instead
introduced the anchor point. The anchor point is an arbitrary reference
point in the (unscaled) coordinate space of the actor to which the basic
actor operations (position, rotation and scaling) are relative.

In 0.5 to scale with 'center gravity', you choose the anchor point so as
to be in the center of the actor (you can use the convenience function
clutter_actor_set_anchor_point_from_gravity() for that, but do not have
to). However, this affects not only the scaling, but also the position
and rotation, so you need to take this into account when setting these
parameters.

The problem in the foophone patch is that the buttons are layout
initially with anchor point of [0,0], and then when the button is
clicked, the callback changes the anchor point to width/2, height/2,
hence the button moves. What should be done is to set the anchor point
when the button is created and then make all the other operations
relative to it.

Tomas



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

Reply via email to