Fixed incorrect order of scaling and rotation in _clutter_actor_apply_modelview_transform()

This commit is contained in:
Tomas Frydrych 2007-06-27 11:34:43 +00:00
parent 4ed86c4bc1
commit 4fda40461e
2 changed files with 20 additions and 7 deletions

View File

@ -1,3 +1,10 @@
2007-06-27 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-actor.c:
(_clutter_actor_apply_modelview_transform):
Fixed incorrect order of scaling an rotation that was causing
objects that were both rotated and scaled to change position.
2007-06-27 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-actor.c:

View File

@ -581,6 +581,18 @@ _clutter_actor_apply_modelview_transform (ClutterActor * self)
0);
}
/*
* because the rotation involves translations, we must scale before
* applying the rotations (if we apply the scale after the rotations,
* the translations included in the rotation are not scaled and so the
* entire object will move on the screen as a result of rotating it).
*/
if (priv->scale_x != CFX_ONE ||
priv->scale_y != CFX_ONE)
{
cogl_scale (priv->scale_x, priv->scale_y);
}
if (priv->rzang)
{
cogl_translate (priv->rzx, priv->rzy, 0);
@ -605,12 +617,6 @@ _clutter_actor_apply_modelview_transform (ClutterActor * self)
if (priv->z)
cogl_translate (0, 0, priv->z);
if (priv->scale_x != CFX_ONE ||
priv->scale_y != CFX_ONE)
{
cogl_scale (priv->scale_x, priv->scale_y);
}
if (priv->has_clip)
cogl_clip_set (&(priv->clip));
}