From 9366a345b47bfb64f1e237392209a71d13114053 Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Mon, 6 Dec 2010 16:29:40 +0900 Subject: [PATCH] Fix GtkCellAreaBox allocate_cells_manually to handle undersized areas. --- gtk/gtkcellareabox.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gtk/gtkcellareabox.c b/gtk/gtkcellareabox.c index 62db9b5aec..e97767962f 100644 --- a/gtk/gtkcellareabox.c +++ b/gtk/gtkcellareabox.c @@ -697,7 +697,10 @@ allocate_cells_manually (GtkCellAreaBox *box, /* Naturally distribute the allocation */ avail_size -= (nvisible - 1) * priv->spacing; - avail_size = gtk_distribute_natural_allocation (avail_size, nvisible, sizes); + if (avail_size > 0) + avail_size = gtk_distribute_natural_allocation (avail_size, nvisible, sizes); + else + avail_size = 0; /* Calculate/distribute expand for cells */ if (nexpand > 0)