From 4ed86c4bc19530f93e064160d159b09911a097fb Mon Sep 17 00:00:00 2001 From: Tomas Frydrych Date: Wed, 27 Jun 2007 09:41:49 +0000 Subject: [PATCH] fixed clutter_actor_scale_with_gravityx() --- ChangeLog | 7 +++++++ clutter/clutter-actor.c | 15 ++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c4e536054..de4a4f1f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-06-27 Tomas Frydrych + + * 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 * clutter/cogl/gl/cogl.c: diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 860a387b6..d3b4a81ac 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -1768,19 +1768,24 @@ clutter_actor_set_scale_with_gravityx (ClutterActor *self, ClutterGravity gravity) { ClutterActorBox box; - gint32 sw, sh, w, h; - gint32 x, y; + ClutterFixed sw, sh, w, h, 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); if (gravity == CLUTTER_GRAVITY_NONE || gravity == CLUTTER_GRAVITY_NORTH_WEST) return; - clutter_actor_get_abs_size_units (self, &sw, &sh); - 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; y = box.y1;