mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 08:30:42 -05:00
fixes for clutter-behaviour-ellipse.c.0.patch
This commit is contained in:
parent
0ffb6f7aa5
commit
c1866858dd
@ -1,48 +1,13 @@
|
||||
diff --git a/clutter/clutter-behaviour-ellipse.c b/clutter/clutter-behaviour-ellipse.c
|
||||
index b9f493b..5524032 100644
|
||||
index 162a949..4212b95 100644
|
||||
--- a/clutter/clutter-behaviour-ellipse.c
|
||||
+++ b/clutter/clutter-behaviour-ellipse.c
|
||||
@@ -86,11 +86,11 @@ struct _ClutterBehaviourEllipsePrivate
|
||||
gint a;
|
||||
gint b;
|
||||
|
||||
- ClutterAngle angle_start;
|
||||
- ClutterAngle angle_end;
|
||||
- ClutterAngle angle_tilt_x;
|
||||
- ClutterAngle angle_tilt_y;
|
||||
- ClutterAngle angle_tilt_z;
|
||||
+ float angle_start;
|
||||
+ float angle_end;
|
||||
+ float angle_tilt_x;
|
||||
+ float angle_tilt_y;
|
||||
+ float angle_tilt_z;
|
||||
|
||||
ClutterRotateDirection direction;
|
||||
};
|
||||
@@ -104,7 +104,7 @@ typedef struct _knot3d
|
||||
|
||||
static void
|
||||
clutter_behaviour_ellipse_advance (ClutterBehaviourEllipse *e,
|
||||
- ClutterAngle angle,
|
||||
+ float angle,
|
||||
knot3d *knot)
|
||||
@@ -190,17 +190,13 @@ actor_apply_knot_foreach (ClutterBehaviour *behave,
|
||||
static inline float
|
||||
clamp_angle (float a)
|
||||
{
|
||||
ClutterBehaviourEllipsePrivate *priv = e->priv;
|
||||
@@ -187,20 +187,16 @@ actor_apply_knot_foreach (ClutterBehaviour *behave,
|
||||
clutter_actor_set_depth (actor, knot->z);
|
||||
}
|
||||
|
||||
-static inline ClutterAngle
|
||||
-clamp_angle (ClutterAngle a)
|
||||
+static float
|
||||
+clamp_angle (float a)
|
||||
{
|
||||
- ClutterAngle a1, a2;
|
||||
- float a1, a2;
|
||||
gint rounds;
|
||||
+
|
||||
+ rounds = a / 360;
|
||||
+ if (a < 0)
|
||||
+ rounds--;
|
||||
|
||||
- /* Need to add the 256 offset here, since the user space 0 maps to our
|
||||
- * -256
|
||||
@ -50,21 +15,15 @@ index b9f493b..5524032 100644
|
||||
- rounds = (a + 256) / 1024;
|
||||
- a1 = rounds * 1024;
|
||||
- a2 = a - a1;
|
||||
-
|
||||
+ rounds = a / 360;
|
||||
+ if (a < 0)
|
||||
+ rounds--;
|
||||
|
||||
- return a2;
|
||||
+ return a - 360 * rounds;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -209,7 +205,7 @@ clutter_behaviour_ellipse_alpha_notify (ClutterBehaviour *behave,
|
||||
{
|
||||
ClutterBehaviourEllipse *self = CLUTTER_BEHAVIOUR_ELLIPSE (behave);
|
||||
ClutterBehaviourEllipsePrivate *priv = self->priv;
|
||||
- ClutterAngle start, end;
|
||||
+ float start, end;
|
||||
knot3d knot;
|
||||
ClutterAngle angle = 0;
|
||||
|
||||
@@ -218,11 +214,11 @@ clutter_behaviour_ellipse_alpha_notify (ClutterBehaviour *behave,
|
||||
|
||||
if (priv->direction == CLUTTER_ROTATE_CW && start >= end)
|
||||
@ -237,12 +196,8 @@ index b9f493b..5524032 100644
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -802,10 +785,10 @@ clutter_behaviour_ellipse_set_angle_startx (ClutterBehaviourEllipse *self,
|
||||
ClutterFixed angle_start)
|
||||
{
|
||||
ClutterBehaviourEllipsePrivate *priv;
|
||||
- ClutterAngle new_angle;
|
||||
+ float new_angle;
|
||||
@@ -805,7 +788,7 @@ clutter_behaviour_ellipse_set_angle_startx (ClutterBehaviourEllipse *self,
|
||||
float new_angle;
|
||||
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self));
|
||||
|
||||
- new_angle = clamp_angle (COGL_ANGLE_FROM_DEGX (angle_start) - 256);
|
||||
@ -282,12 +237,7 @@ index b9f493b..5524032 100644
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -887,11 +871,11 @@ clutter_behaviour_ellipse_set_angle_endx (ClutterBehaviourEllipse *self,
|
||||
ClutterFixed angle_end)
|
||||
{
|
||||
ClutterBehaviourEllipsePrivate *priv;
|
||||
- ClutterAngle new_angle;
|
||||
+ float new_angle;
|
||||
@@ -891,7 +875,7 @@ clutter_behaviour_ellipse_set_angle_endx (ClutterBehaviourEllipse *self,
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self));
|
||||
|
||||
@ -329,12 +279,7 @@ index b9f493b..5524032 100644
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -979,11 +963,11 @@ clutter_behaviour_ellipse_set_angle_tiltx (ClutterBehaviourEllipse *self,
|
||||
ClutterFixed angle_tilt)
|
||||
{
|
||||
ClutterBehaviourEllipsePrivate *priv;
|
||||
- ClutterAngle new_angle;
|
||||
+ float new_angle;
|
||||
@@ -983,7 +967,7 @@ clutter_behaviour_ellipse_set_angle_tiltx (ClutterBehaviourEllipse *self,
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self));
|
||||
|
||||
@ -373,39 +318,29 @@ index b9f493b..5524032 100644
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -1096,13 +1080,13 @@ clutter_behaviour_ellipse_set_tilt (ClutterBehaviourEllipse *self,
|
||||
gdouble angle_tilt_z)
|
||||
{
|
||||
ClutterBehaviourEllipsePrivate *priv;
|
||||
- ClutterAngle new_angle_x, new_angle_y, new_angle_z;
|
||||
+ float new_angle_x, new_angle_y, new_angle_z;
|
||||
@@ -1100,9 +1084,9 @@ clutter_behaviour_ellipse_set_tilt (ClutterBehaviourEllipse *self,
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self));
|
||||
|
||||
- new_angle_x = COGL_ANGLE_FROM_DEG (angle_tilt_x);
|
||||
- new_angle_y = COGL_ANGLE_FROM_DEG (angle_tilt_y);
|
||||
- new_angle_z = COGL_ANGLE_FROM_DEG (angle_tilt_z);
|
||||
+ new_angle_x = angle_tilt_x;
|
||||
+ new_angle_y = angle_tilt_y;
|
||||
+ new_angle_z = angle_tilt_z;
|
||||
+ new_angle_x = (float)angle_tilt_x;
|
||||
+ new_angle_y = (float)angle_tilt_y;
|
||||
+ new_angle_z = (float)angle_tilt_z;
|
||||
|
||||
priv = self->priv;
|
||||
|
||||
@@ -1150,13 +1134,13 @@ clutter_behaviour_ellipse_set_tiltx (ClutterBehaviourEllipse *self,
|
||||
ClutterFixed angle_tilt_z)
|
||||
{
|
||||
ClutterBehaviourEllipsePrivate *priv;
|
||||
- ClutterAngle new_angle_x, new_angle_y, new_angle_z;
|
||||
+ float new_angle_x, new_angle_y, new_angle_z;
|
||||
@@ -1154,9 +1138,9 @@ clutter_behaviour_ellipse_set_tiltx (ClutterBehaviourEllipse *self,
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self));
|
||||
|
||||
- new_angle_x = COGL_ANGLE_FROM_DEGX (angle_tilt_x);
|
||||
- new_angle_y = COGL_ANGLE_FROM_DEGX (angle_tilt_y);
|
||||
- new_angle_z = COGL_ANGLE_FROM_DEGX (angle_tilt_z);
|
||||
+ new_angle_x = angle_tilt_x;
|
||||
+ new_angle_y = angle_tilt_y;
|
||||
+ new_angle_z = angle_tilt_z;
|
||||
+ new_angle_x = CLUTTER_FIXED_TO_FLOAT (angle_tilt_x);
|
||||
+ new_angle_y = CLUTTER_FIXED_TO_FLOAT (angle_tilt_y);
|
||||
+ new_angle_z = CLUTTER_FIXED_TO_FLOAT (angle_tilt_z);
|
||||
|
||||
priv = self->priv;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user