cookbook: Further clarification of the anchor point
authorEmmanuele Bassi <ebassi@linux.intel.com>
Thu, 23 Sep 2010 16:03:17 +0000 (17:03 +0100)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Thu, 23 Sep 2010 16:03:17 +0000 (17:03 +0100)
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

index f9496a9..862aeb8 100644 (file)
@@ -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 <function>clutter_anchor_set_anchor_point()</function>
-        function. For example:</para>
+        function.</para>
+
+        <para>For example:</para>
 
         <informalexample>
           <programlisting>
@@ -2023,6 +2025,19 @@ clutter_actor_set_anchor_point (actor, 50.0, 0.0);
           </programlisting>
         </informalexample>
 
+        <note>
+          <para>In GL terms, the anchor point of an actor is the equivalent
+          of applying an additional transformation of <code>-x, -y</code> to
+          the actor's modelview. If the anchor point is <code>0, 0</code>,
+          i.e. the top-left corner, then the transformation will leave the
+          actor in the same place.</para>
+          <para>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.</para>
+          <para>Finally, the anchor point will affect the other transformations
+          that can be applied to an actor: scaling and rotating.</para>
+        </note>
+
         <para>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