[animation] Move the alpha value to floating point
The current Alpha value is an unsigned integer that can be used implicitly as a fixed point value. This makes writing an alpha function overshooting below and above the current range basically impossible without complicating an already complex code, and creating weird corner cases. For this reason, the Alpha value should be defined as a floating point normalized value, spanning a range between 0.0 and 1.0; in order to allow overshooting, the valid range is extended one unit below and one unit above, thus making it -1.0 .. 2.0. This commit updates the various users of the ClutterAlpha API and the tests cases. This commit also removes all the current alpha functions exposed in the public API.
This commit is contained in:
@ -123,7 +123,7 @@ actor_apply_knot_foreach (ClutterBehaviour *behaviour,
|
||||
|
||||
static void
|
||||
clutter_behaviour_path_alpha_notify (ClutterBehaviour *behave,
|
||||
guint32 alpha_value)
|
||||
gdouble alpha_value)
|
||||
{
|
||||
ClutterBehaviourPath *pathb = CLUTTER_BEHAVIOUR_PATH (behave);
|
||||
ClutterBehaviourPathPrivate *priv = pathb->priv;
|
||||
@ -131,10 +131,7 @@ clutter_behaviour_path_alpha_notify (ClutterBehaviour *behave,
|
||||
guint knot_num;
|
||||
|
||||
if (priv->path)
|
||||
knot_num = clutter_path_get_position (priv->path,
|
||||
alpha_value
|
||||
/ (gdouble) CLUTTER_ALPHA_MAX_ALPHA,
|
||||
&position);
|
||||
knot_num = clutter_path_get_position (priv->path, alpha_value, &position);
|
||||
else
|
||||
{
|
||||
memset (&position, 0, sizeof (position));
|
||||
|
Reference in New Issue
Block a user