From bff5afe72401eba483b4e694f3836556d130e383 Mon Sep 17 00:00:00 2001 From: Matthew Allum Date: Thu, 31 Aug 2006 18:54:51 +0000 Subject: [PATCH] 2006-08-31 Matthew Allum * clutter/clutter-actor.c: * clutter/clutter-group.c: (clutter_group_paint), (clutter_group_request_coords), (clutter_group_allocate_coords), (clutter_group_add): Fix some group sizing/positioning issues. --- ChangeLog | 8 ++++++++ clutter/clutter-actor.c | 2 +- clutter/clutter-group.c | 28 ++++++++++++++++------------ 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ce2d0f7d..dcc8fc8ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-08-31 Matthew Allum + + * clutter/clutter-actor.c: + * clutter/clutter-group.c: (clutter_group_paint), + (clutter_group_request_coords), (clutter_group_allocate_coords), + (clutter_group_add): + Fix some group sizing/positioning issues. + 2006-08-30 Jorn Baayen * clutter.pc.in: diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 192ef1e1f..e43eb2b7a 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -410,7 +410,7 @@ clutter_actor_request_coords (ClutterActor *self, **/ void clutter_actor_allocate_coords (ClutterActor *self, - ClutterActorBox *box) + ClutterActorBox *box) { ClutterActorClass *klass; diff --git a/clutter/clutter-group.c b/clutter/clutter-group.c index ce15a6295..2a73fa563 100644 --- a/clutter/clutter-group.c +++ b/clutter/clutter-group.c @@ -76,7 +76,9 @@ clutter_group_paint (ClutterActor *actor) clutter_actor_get_geometry (actor, &geom); if (geom.x != 0 || geom.y != 0) - glTranslatef(geom.x, geom.y, 0.0); + { + glTranslatef(geom.x, geom.y, 0.0); + } } @@ -103,11 +105,11 @@ clutter_group_request_coords (ClutterActor *self, clutter_actor_allocate_coords (self, &cbox); - /* Sizing requests fail, use scale() instead */ - box->x1 = cbox.x1; - box->y1 = cbox.y1; - box->x2 = cbox.x2; - box->y2 = cbox.y2; + /* Only positioning works. + * Sizing requests fail, use scale() instead + */ + box->x2 = box->x1 + (cbox.x2 - cbox.x1); + box->y2 = box->y1 + (cbox.y2 - cbox.y1); } static void @@ -121,22 +123,26 @@ clutter_group_allocate_coords (ClutterActor *self, child_item = priv->children; + /* FIXME: Cache these values */ + if (child_item) { do { ClutterActor *child = CLUTTER_ACTOR(child_item->data); - - if (CLUTTER_ACTOR_IS_VISIBLE (child)) + + /* Once added we include in sizing - doesn't matter if visible */ + /* if (CLUTTER_ACTOR_IS_VISIBLE (child)) */ { ClutterActorBox cbox; clutter_actor_allocate_coords (child, &cbox); /* Ignore any children with offscreen ( negaive ) - * positions + * positions. + * + * Also x1 and x2 will be set by parent caller. */ - if (box->x2 == 0 || cbox.x2 > box->x2) box->x2 = cbox.x2; @@ -350,8 +356,6 @@ clutter_group_add (ClutterGroup *self, clutter_group_sort_depth_order (self); - /* If were scaled, we scale the actor too */ - g_signal_emit (self, group_signals[ADD], 0, actor); g_object_unref (actor);