2006-08-31 Matthew Allum <mallum@openedhand.com>

* 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.
This commit is contained in:
Matthew Allum 2006-08-31 18:54:51 +00:00
parent 76d1b5fd5b
commit bff5afe724
3 changed files with 25 additions and 13 deletions

View File

@ -1,3 +1,11 @@
2006-08-31 Matthew Allum <mallum@openedhand.com>
* 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 <jorn@openedhand.com>
* clutter.pc.in:

View File

@ -410,7 +410,7 @@ clutter_actor_request_coords (ClutterActor *self,
**/
void
clutter_actor_allocate_coords (ClutterActor *self,
ClutterActorBox *box)
ClutterActorBox *box)
{
ClutterActorClass *klass;

View File

@ -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);