From 98016e190a5dc441613d9c10e07a1ea6a9371324 Mon Sep 17 00:00:00 2001 From: Samuel Degrande Date: Fri, 18 May 2012 15:32:10 +0200 Subject: Wrong position of the last child of a BoxLayout. When the first child of a box layout container is invisible, the position of the last displayed child is wrong. ClutterBoxLayout::allocate() first computes the sizes needed for each of the visible children and stores those sizes into a 'sizes' array (the array counter is incremented on visible children only). Later on, ClutterBoxLayout::allocate() computes the position of each visible children, using the 'sizes' array. However, it uses the child index to access the array, instead of a 'visible child index'. https://bugzilla.gnome.org/show_bug.cgi?id=669291 --- clutter/clutter-box-layout.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clutter/clutter-box-layout.c b/clutter/clutter-box-layout.c index 9e063864f..937bad3a3 100644 --- a/clutter/clutter-box-layout.c +++ b/clutter/clutter-box-layout.c @@ -1033,7 +1033,7 @@ clutter_box_layout_allocate (ClutterLayoutManager *layout, x = box->x1; } - for (l = children, i = 0; l != NULL; l = l->next, i += 1) + for (l = children, i = 0; l != NULL; l = l->next) { ClutterLayoutMeta *meta; ClutterBoxChild *box_child; @@ -1141,6 +1141,8 @@ clutter_box_layout_allocate (ClutterLayoutManager *layout, child, &child_allocation, flags); + + i++; } g_list_free (children); -- cgit v1.2.1