+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:
* <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,
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;