* clutter/clutter-fixed.c: (clutter_sinx):
authorChris Lord <chris@openedhand.com>
Wed, 25 Jun 2008 13:21:25 +0000 (13:21 +0000)
committerChris Lord <chris@openedhand.com>
Wed, 25 Jun 2008 13:21:25 +0000 (13:21 +0000)
        Fix clutter_sinx for angles > CFX_2PI - CFX_ONE. Also add note to
        documentation about being able to use modulus with ClutterFixed

ChangeLog
clutter/clutter-fixed.c

index f162f39..47fcec6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-06-25  Chris Lord  <chris@openedhand.com>
+
+       * clutter/clutter-fixed.c: (clutter_sinx):
+       Fix clutter_sinx for angles > CFX_2PI - CFX_ONE. Also add note to
+       documentation about being able to use modulus with ClutterFixed
+
 2008-06-25  Emmanuele Bassi  <ebassi@openedhand.com>
 
        * clutter/clutter-backend.h:
index 5ed7658..22a38aa 100644 (file)
@@ -50,8 +50,8 @@
  *
  * <itemizedlist>
  *   <listitem>
- *     <para>Two fixed point numbers can be directly added and
- *     subtracted.</para>
+ *     <para>Two fixed point numbers can be directly added,
+ *     subtracted and have their modulus taken.</para>
  *   </listitem>
  *   <listitem>
  *     <para>To add other numerical type to a fixed point number it has to
@@ -264,11 +264,7 @@ clutter_sinx (ClutterFixed angle)
     }
 
     /* reduce to <0, 2*pi) */
-    if (angle >= CFX_2PI)
-    {
-       ClutterFixed f = CLUTTER_FIXED_DIV (angle, CFX_2PI);
-       angle = angle - f;
-    }
+    angle = angle % CFX_2PI;
 
     /* reduce to first quadrant and sign */
     if (angle > CFX_PI)