[gtk+] GtkBox: Clipped values passed to gtk_distribute_natural_allocation() incase allocated less than requ



commit 0cb7aa9c7bf9c2ae051ee49e8ad7c0d79f4befe5
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Wed Aug 18 19:32:25 2010 -0400

    GtkBox: Clipped values passed to gtk_distribute_natural_allocation() incase allocated less than requested.

 gtk/gtkbox.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c
index cdc5f1d..1f9b637 100644
--- a/gtk/gtkbox.c
+++ b/gtk/gtkbox.c
@@ -500,7 +500,7 @@ gtk_box_size_allocate (GtkWidget     *widget,
   else
     {
       /* Bring children up to size first */
-      size = gtk_distribute_natural_allocation (size, nvis_children, sizes);
+      size = gtk_distribute_natural_allocation (MAX (0, size), nvis_children, sizes);
 
       /* Calculate space which hasn't distributed yet,
        * and is available for expanding children.
@@ -1004,7 +1004,7 @@ gtk_box_compute_size_for_opposing_orientation (GtkBox *box,
   else
     {
       /* Bring children up to size first */
-      size = gtk_distribute_natural_allocation (size, nvis_children, sizes);
+      size = gtk_distribute_natural_allocation (MAX (0, size), nvis_children, sizes);
 
       /* Calculate space which hasn't distributed yet,
        * and is available for expanding children.



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