From 60f162b7bf3530023b47c3b2ba3bcaa0b8f439e4 Mon Sep 17 00:00:00 2001 From: Tomas Frydrych Date: Thu, 7 Feb 2008 18:37:11 +0000 Subject: [PATCH] 2008-02-07 Tomas Frydrych * clutter/clutter-group.c: (clutter_group_query_coords): Take into account the anchor point when calculating the box size. --- ChangeLog | 6 ++++++ clutter/clutter-group.c | 17 ++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ff7c4d217..720f4be47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-07 Tomas Frydrych + + * clutter/clutter-group.c: + (clutter_group_query_coords): + Take into account the anchor point when calculating the box size. + 2008-02-07 Emmanuele Bassi * clutter/clutter-actor.c: Add a note on clutter_actor_set_size() diff --git a/clutter/clutter-group.c b/clutter/clutter-group.c index 75ee9919f..5461bfe9d 100644 --- a/clutter/clutter-group.c +++ b/clutter/clutter-group.c @@ -34,9 +34,7 @@ * * A #ClutterGroup's size is defined by the size and position of it * it children. Resize requests via parent #ClutterActor API will be - * ignored, i.e. calling clutter_actor_set_size() on a #ClutterGroup - * will not resize the group nor its children. If you want to resize - * a group, call clutter_actor_set_scale(). + * ignored. */ #ifdef HAVE_CONFIG_H @@ -175,9 +173,22 @@ clutter_group_query_coords (ClutterActor *self, /* if (CLUTTER_ACTOR_IS_VISIBLE (child)) */ { ClutterActorBox cbox; + gint anchor_x; + gint anchor_y; clutter_actor_query_coords (child, &cbox); + /* + * Must adjust these by the anchor point, as we need the box + * to be relative to the top-left corner of the parent + */ + clutter_actor_get_anchor_pointu (child, &anchor_x, &anchor_y); + + cbox.x1 -= anchor_x; + cbox.x2 -= anchor_x; + cbox.y1 -= anchor_y; + cbox.y2 -= anchor_y; + /* Ignore any children with offscreen ( negaive ) * positions. *