summaryrefslogtreecommitdiff
path: root/gtk/gtkcellareabox.c
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2010-12-06 16:29:40 +0900
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2010-12-06 16:29:40 +0900
commit9366a345b47bfb64f1e237392209a71d13114053 (patch)
tree88579ebddeac556ad00e8962160624bdb70da9fc /gtk/gtkcellareabox.c
parentc6572265cb124d28fa35514bf3d569797c2beed6 (diff)
downloadgtk+-9366a345b47bfb64f1e237392209a71d13114053.tar.gz
Fix GtkCellAreaBox allocate_cells_manually to handle undersized areas.
Diffstat (limited to 'gtk/gtkcellareabox.c')
-rw-r--r--gtk/gtkcellareabox.c5
1 files changed, 4 insertions, 1 deletions
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)