[gtk+] flow box: Fix bad children allocation with RTL locales



commit 7a676cdc14ae854f8fd6817bdaa99ae88df56973
Author: Rafal Luzynski <digitalfreak lingonborough com>
Date:   Fri Sep 4 11:21:08 2015 +0200

    flow box: Fix bad children allocation with RTL locales
    
    If the position of the children is always relative to the box
    then we should not take the allocation of the box into account
    when flipping the children for RTL text direction.
    
    This patch also removes unused assignments to child_allocation.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=754559

 gtk/gtkflowbox.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c
index 8b65d65..f53e908 100644
--- a/gtk/gtkflowbox.c
+++ b/gtk/gtkflowbox.c
@@ -1606,11 +1606,6 @@ gtk_flow_box_size_allocate (GtkWidget     *widget,
   gint i, this_line_size;
   GSequenceIter *iter;
 
-  child_allocation.x = 0;
-  child_allocation.y = 0;
-  child_allocation.width = 0;
-  child_allocation.height = 0;
-
   gtk_widget_set_allocation (widget, allocation);
   window = gtk_widget_get_window (widget);
   if (window != NULL)
@@ -1618,10 +1613,6 @@ gtk_flow_box_size_allocate (GtkWidget     *widget,
                             allocation->x, allocation->y,
                             allocation->width, allocation->height);
 
-  child_allocation.x = 0;
-  child_allocation.y = 0;
-  child_allocation.width = allocation->width;
-
   min_items = MAX (1, priv->min_children_per_line);
 
   if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
@@ -1938,7 +1929,7 @@ gtk_flow_box_size_allocate (GtkWidget     *widget,
         }
 
       if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
-        child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - 
child_allocation.width;
+        child_allocation.x = allocation->width - child_allocation.x - child_allocation.width;
       gtk_widget_size_allocate (child, &child_allocation);
 
       item_offset += this_item_size;


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