[gtk+] Fix natural/min widht calculations for empty grids



commit bb1d9aba86af715e5a5c53d5ad3b7dfcb720634e
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Oct 21 16:23:03 2011 -0400

    Fix natural/min widht calculations for empty grids
    
    https://bugzilla.gnome.org/show_bug.cgi?id=660139

 gtk/gtkgrid.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkgrid.c b/gtk/gtkgrid.c
index df0c114..5ef4a6f 100644
--- a/gtk/gtkgrid.c
+++ b/gtk/gtkgrid.c
@@ -927,8 +927,13 @@ gtk_grid_request_sum (GtkGridRequest *request,
   linedata = &priv->linedata[orientation];
   lines = &request->lines[orientation];
 
-  min = (nonempty - 1) * linedata->spacing;
-  nat = (nonempty - 1) * linedata->spacing;
+  min = 0;
+  nat = 0;
+  if (nonempty > 0)
+    {
+      min = (nonempty - 1) * linedata->spacing;
+      nat = (nonempty - 1) * linedata->spacing;
+    }
 
   for (i = 0; i < lines->max - lines->min; i++)
     {



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