[gtk+/native-layout-incubator] Fix a regression in RTL flipping



commit ff0eb0320136fe7f254edcec978f8af0df8436b9
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Apr 25 16:23:01 2010 -0400

    Fix a regression in RTL flipping
    
    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 |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c
index 9600969..76dd255 100644
--- a/gtk/gtkbox.c
+++ b/gtk/gtkbox.c
@@ -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;



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