[cairo-commit] goocanvas/src goocanvastable.c,1.14,1.15

Damon Chaplin commit at pdx.freedesktop.org
Fri Nov 23 07:34:35 PST 2007


Committed by: damon

Update of /cvs/cairo/goocanvas/src
In directory kemper:/tmp/cvs-serv29666/src

Modified Files:
	goocanvastable.c 
Log Message:
2007-11-23  Damon Chaplin  <damon at gnome.org>

	* src/goocanvastable.c (goo_canvas_table_size_allocate_pass1): when
	shrinking, make sure the extra value is always decreasing, so we don't
	get into an infinite loop.



Index: goocanvastable.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvastable.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- goocanvastable.c	13 Aug 2007 11:18:23 -0000	1.14
+++ goocanvastable.c	23 Nov 2007 15:34:33 -0000	1.15
@@ -1392,7 +1392,7 @@
   GooCanvasTableLayoutData *layout_data = table_data->layout_data;
   GooCanvasTableDimension *dimension;
   GooCanvasTableDimensionLayoutData *dldata;
-  gdouble total_size, size_to_allocate, natural_size, extra;
+  gdouble total_size, size_to_allocate, natural_size, extra, old_extra;
   gint i, nexpand, nshrink;
   
   /* If we were allocated more space than we requested
@@ -1492,6 +1492,7 @@
 	  while (total_nshrink > 0 && extra > 0)
 	    {
 	      nshrink = total_nshrink;
+	      old_extra = extra;
 	      for (i = 0; i < dimension->size; i++)
 		{
 		  if (dldata[i].shrink && dldata[i].allocation > 0.0)
@@ -1511,6 +1512,8 @@
 			total_nshrink -= 1;
 		    }
 		}
+	      if (extra >= old_extra)
+		break;
 	    }
 	}
     }



More information about the cairo-commit mailing list