]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkvbox.c
More extensive debugging output
[~andy/gtk] / gtk / gtkvbox.c
index a26f33ebc185d79efa9fd6127cf599504d527d0a..46993902dd33123671703f5fe44b945820809ef4 100644 (file)
@@ -187,7 +187,7 @@ gtk_vbox_size_allocate (GtkWidget     *widget,
        }
       else if (nexpand_children > 0)
        {
-         height = allocation->height - widget->requisition.height;
+         height = (gint)allocation->height - (gint)widget->requisition.height;
          extra = height / nexpand_children;
        }
       else
@@ -198,7 +198,7 @@ gtk_vbox_size_allocate (GtkWidget     *widget,
 
       y = allocation->y + GTK_CONTAINER (box)->border_width;
       child_allocation.x = allocation->x + GTK_CONTAINER (box)->border_width;
-      child_allocation.width = allocation->width - GTK_CONTAINER (box)->border_width * 2;
+      child_allocation.width = MAX (0, allocation->width - GTK_CONTAINER (box)->border_width * 2);
 
       children = box->children;
       while (children)
@@ -236,7 +236,7 @@ gtk_vbox_size_allocate (GtkWidget     *widget,
 
              if (child->fill)
                {
-                 child_allocation.height = child_height - child->padding * 2;
+                 child_allocation.height = MAX (0, child_height - child->padding * 2);
                  child_allocation.y = y + child->padding;
                }
              else
@@ -289,7 +289,7 @@ gtk_vbox_size_allocate (GtkWidget     *widget,
 
               if (child->fill)
                 {
-                  child_allocation.height = child_height - child->padding * 2;
+                  child_allocation.height = MAX (0, child_height - child->padding * 2);
                   child_allocation.y = y + child->padding - child_height;
                 }
               else