2008-02-11 Matthew Allum <mallum@openedhand.com>
authorMatthew Allum <mallum@openedhand.com>
Mon, 11 Feb 2008 20:31:16 +0000 (20:31 +0000)
committerMatthew Allum <mallum@openedhand.com>
Mon, 11 Feb 2008 20:31:16 +0000 (20:31 +0000)
        * clutter/clutter-actor.c:
        Minor documentation tweak to class description.

        * clutter/clutter-behaviour-scale.c:
        'Force' start + end vals of scale behaviour
        (#779, Havoc Pennington)

ChangeLog
clutter/clutter-actor.c
clutter/clutter-behaviour-scale.c

index 82109d7..28af46f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-02-11  Matthew Allum  <mallum@openedhand.com>
+
+       * clutter/clutter-actor.c:
+        Minor documentation tweak to class description.
+
+       * clutter/clutter-behaviour-scale.c:
+        'Force' start + end vals of scale behaviour 
+        (#779, Havoc Pennington)
+
 2008-02-11  Emmanuele Bassi  <ebassi@openedhand.com>
 
        * README:
index 9e15af0..9fd28ed 100644 (file)
@@ -2376,7 +2376,8 @@ clutter_actor_set_size_internalu (ClutterActor *self,
  * <note>This function is a "request" to the #ClutterActor. Depending
  * on the actual implementation, calling clutter_actor_set_size() might
  * not produce visible results. Calling this function on a #ClutterGroup,
- * for instance, will not resize the group.</note>
+ * for instance, will not resize the group - as its size is dependant
+ * on bounding box of actual contents</note>
  */
 void
 clutter_actor_set_size (ClutterActor *self,
index 30c5785..46b5e04 100644 (file)
@@ -93,20 +93,38 @@ clutter_behaviour_scale_alpha_notify (ClutterBehaviour *behave,
                                       guint32           alpha_value)
 {
   ClutterBehaviourScalePrivate *priv;
-  ClutterFixed scale_x, scale_y, factor;
+  ClutterFixed scale_x, scale_y;
   ScaleFrameClosure closure = { 0, };
 
   priv = CLUTTER_BEHAVIOUR_SCALE (behave)->priv;
 
-  factor = CLUTTER_INT_TO_FIXED (alpha_value) / CLUTTER_ALPHA_MAX_ALPHA;
+  /* Fix the start/end values, avoids potential rounding errors on large
+   * values. 
+  */
+  if (alpha_value == CLUTTER_ALPHA_MAX_ALPHA)
+    {
+      scale_x = priv->x_scale_end;
+      scale_y = priv->y_scale_end;
+    }
+  else if (alpha_value == 0)
+    {
+      scale_x = priv->x_scale_start;
+      scale_y = priv->y_scale_start;
+    }
+  else
+    {
+      ClutterFixed factor;
 
-  scale_x = CLUTTER_FIXED_MUL (factor,
-                               (priv->x_scale_end - priv->x_scale_start));
-  scale_x += priv->x_scale_start;
+      factor = CLUTTER_INT_TO_FIXED (alpha_value) / CLUTTER_ALPHA_MAX_ALPHA;
 
-  scale_y = CLUTTER_FIXED_MUL (factor,
-                               (priv->y_scale_end - priv->y_scale_start));
-  scale_y += priv->y_scale_start;
+      scale_x = CLUTTER_FIXED_MUL (factor,
+                                   (priv->x_scale_end - priv->x_scale_start));
+      scale_x += priv->x_scale_start;
+      
+      scale_y = CLUTTER_FIXED_MUL (factor,
+                                   (priv->y_scale_end - priv->y_scale_start));
+      scale_y += priv->y_scale_start;
+    }
 
   closure.scale_x = scale_x;
   closure.scale_y = scale_y;