From 4533edeef03b452aa79671fd6f80e659b2f09fa9 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 23 Sep 2010 17:03:17 +0100 Subject: [PATCH] cookbook: Further clarification of the anchor point Make sure to add a note on the behaviour of the anchor point. Ideally, it would be nice to have a recipe about it in the Actor section. --- doc/cookbook/animations.xml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/cookbook/animations.xml b/doc/cookbook/animations.xml index f9496a9ae..862aeb889 100644 --- a/doc/cookbook/animations.xml +++ b/doc/cookbook/animations.xml @@ -2011,7 +2011,9 @@ clutter_animator_start (animator); corner. However, it is possible to set this to some other coordinate, relative to the actor's top-left corner, using the clutter_anchor_set_anchor_point() - function. For example: + function. + + For example: @@ -2023,6 +2025,19 @@ clutter_actor_set_anchor_point (actor, 50.0, 0.0); + + In GL terms, the anchor point of an actor is the equivalent + of applying an additional transformation of -x, -y to + the actor's modelview. If the anchor point is 0, 0, + i.e. the top-left corner, then the transformation will leave the + actor in the same place. + It is important to note that the anchor point will affect the + position in which an actor is painted, but will not change the + position or size that its parent allocated for it. + Finally, the anchor point will affect the other transformations + that can be applied to an actor: scaling and rotating. + + A positive anchor point within the width/height bounds of the actor is inside the actor. An anchor point outside these bounds is outside the actor. You can also set a negative