]> Pileus Git - ~andy/gtk/commitdiff
Fix a regression in RTL flipping
authorMatthias Clasen <mclasen@redhat.com>
Sun, 25 Apr 2010 20:23:01 +0000 (16:23 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 25 Apr 2010 20:23:01 +0000 (16:23 -0400)
This was only showing up with pack-end packing in horizontal boxes.
The RTL flipping has to be applied after moving the reference point
to the left edge of the child.

gtk/gtkbox.c

index 96009696be30dfa2506c1834e36fe7c8e08a3b0b..76dd255354e2d2afe71ee5fd6f0e9ab3d27812c6 100644 (file)
@@ -555,9 +555,6 @@ gtk_box_size_allocate (GtkWidget     *widget,
                              child_allocation.width = sizes[i].minimum_size;
                               child_allocation.x = x + (child_size - child_allocation.width) / 2;
                            }
-                         
-                         if (direction == GTK_TEXT_DIR_RTL)
-                            child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - child_allocation.width;
 
                           if (packing == GTK_PACK_START)
                            {
@@ -567,8 +564,12 @@ gtk_box_size_allocate (GtkWidget     *widget,
                            {
                              x -= child_size + box->spacing;
 
-                             child_allocation.x -= child_allocation.width;
+                             child_allocation.x -= child_size;
                            }
+
+                         if (direction == GTK_TEXT_DIR_RTL)
+                            child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - child_allocation.width;
+
                         }
                       else /* (private->orientation == GTK_ORIENTATION_VERTICAL) */
                         {
@@ -591,11 +592,10 @@ gtk_box_size_allocate (GtkWidget     *widget,
                           {
                             y -= child_size + box->spacing;
 
-                            child_allocation.y -= child_allocation.height;
+                            child_allocation.y -= child_size;
                           }
                         }
                      gtk_widget_size_allocate (child->widget, &child_allocation);
-
                     }
 
                  i += 1;