fixed clutter_actor_scale_with_gravityx()

This commit is contained in:
Tomas Frydrych 2007-06-27 09:41:49 +00:00
parent 761a5f4d9d
commit 4ed86c4bc1
2 changed files with 17 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2007-06-27 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-actor.c:
(clutter_actor_scale_with_gravityx):
Made to work after changes to the behavivour of
clutter_actor_get_absolute_size() for rotated actors.
2007-06-26 Tomas Frydrych <tf@openedhand.com> 2007-06-26 Tomas Frydrych <tf@openedhand.com>
* clutter/cogl/gl/cogl.c: * clutter/cogl/gl/cogl.c:

View File

@ -1768,19 +1768,24 @@ clutter_actor_set_scale_with_gravityx (ClutterActor *self,
ClutterGravity gravity) ClutterGravity gravity)
{ {
ClutterActorBox box; ClutterActorBox box;
gint32 sw, sh, w, h; ClutterFixed sw, sh, w, h, x, y;
gint32 x, y; ClutterFixed old_scale_x, old_scale_y;
clutter_actor_get_abs_size_units (self, &w, &h); clutter_actor_get_scalex (self, &old_scale_x, &old_scale_y);
clutter_actor_set_scalex (self, scale_x, scale_y); clutter_actor_set_scalex (self, scale_x, scale_y);
if (gravity == CLUTTER_GRAVITY_NONE || if (gravity == CLUTTER_GRAVITY_NONE ||
gravity == CLUTTER_GRAVITY_NORTH_WEST) gravity == CLUTTER_GRAVITY_NORTH_WEST)
return; return;
clutter_actor_get_abs_size_units (self, &sw, &sh);
clutter_actor_query_coords (self, &box); clutter_actor_query_coords (self, &box);
w = CFX_MUL (box.x2 - box.x1, old_scale_x);
h = CFX_MUL (box.y2 - box.y1, old_scale_y);
sw = CFX_MUL (box.x2 - box.x1, scale_x);
sh = CFX_MUL (box.y2 - box.y1, scale_y);
x = box.x1; x = box.x1;
y = box.y1; y = box.y1;