[clutter/clutter-1.8] Wrong position of the last child of a BoxLayout.



commit 98016e190a5dc441613d9c10e07a1ea6a9371324
Author: Samuel Degrande <Samuel Degrande lifl fr>
Date:   Fri May 18 15:32:10 2012 +0200

    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 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/clutter/clutter-box-layout.c b/clutter/clutter-box-layout.c
index 9e06386..937bad3 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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]