[gtk+] grid: Simplify allocating children



commit e7e3ef9d3eca085616ee86adcfe9080aa7e807a2
Author: Timm Bäder <mail baedert org>
Date:   Wed Oct 11 08:25:20 2017 +0200

    grid: Simplify allocating children
    
    allocation->x and allocation->y are always 0. MAX'ing width/height with
    1 is also wrong now since 0 is a valid width/height for widgets.

 gtk/gtkgrid.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkgrid.c b/gtk/gtkgrid.c
index 16b6a89..50d2865 100644
--- a/gtk/gtkgrid.c
+++ b/gtk/gtkgrid.c
@@ -1573,10 +1573,10 @@ gtk_grid_request_allocate_children (GtkGridRequest      *request,
       allocate_child (request, GTK_ORIENTATION_HORIZONTAL, child, &x, &width, &ignore);
       allocate_child (request, GTK_ORIENTATION_VERTICAL, child, &y, &height, &baseline);
 
-      child_allocation.x = allocation->x + x;
-      child_allocation.y = allocation->y + y;
-      child_allocation.width = MAX (1, width);
-      child_allocation.height = MAX (1, height);
+      child_allocation.x = x;
+      child_allocation.y = y;
+      child_allocation.width = width;
+      child_allocation.height = height;
 
       if (_gtk_widget_get_direction (GTK_WIDGET (request->grid)) == GTK_TEXT_DIR_RTL)
         child_allocation.x = allocation->x + allocation->width


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