[cairo-commit] goocanvas/src goocanvas.c, 1.23, 1.24 goocanvasimage.c, 1.17, 1.18 goocanvasitem.c, 1.32, 1.33 goocanvasitemmodel.c, 1.15, 1.16

Damon Chaplin commit at pdx.freedesktop.org
Tue Nov 13 06:30:54 PST 2007


Committed by: damon

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

Modified Files:
	goocanvas.c goocanvasimage.c goocanvasitem.c 
	goocanvasitemmodel.c 
Log Message:
2007-11-13  Murray Cumming  <murrayc at murrayc.com>

	* src/goocanvasitem.c: goo_canvas_item_add_child():
	* src/goocanvasitemmodel.c: goo_canvas_item_model_add_child(): 
	Add a debugging check to make sure the child is not the same as the
	parent, preventing an endless loop.

2007-11-13  Murray Cumming  <murrayc at murrayc.com>

	* src/goocanvasimage.c: goo_canvas_image_set_common_property(): 
	Support setting the pixbuf property to NULL. 

2007-11-13  Murray Cumming  <murrayc at murrayc.com>

	* src/goocanvas.c: goo_canvas_render(): Call goo_canvas_update() 
	if necessary, as suggested by Damon, to fix a crash when rendering 
	a GooCanvasTable that has never been shown on screen.



Index: goocanvas.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvas.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- goocanvas.c	20 Jun 2007 12:59:48 -0000	1.23
+++ goocanvas.c	13 Nov 2007 14:30:52 -0000	1.24
@@ -2297,6 +2297,9 @@
 		   const GooCanvasBounds *bounds,
 		   gdouble                scale)
 {
+  if (canvas->need_update)
+    goo_canvas_update (canvas);
+
   /* Set the default line width based on the current units setting. */
   cairo_set_line_width (cr, goo_canvas_get_default_line_width (canvas));
 

Index: goocanvasimage.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasimage.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- goocanvasimage.c	3 Apr 2007 09:58:05 -0000	1.17
+++ goocanvasimage.c	13 Nov 2007 14:30:52 -0000	1.18
@@ -295,9 +295,9 @@
     case PROP_PIXBUF:
       cairo_pattern_destroy (image_data->pattern);
       pixbuf = g_value_get_object (value);
-      image_data->pattern = goo_canvas_cairo_pattern_from_pixbuf (pixbuf);
-      image_data->width = gdk_pixbuf_get_width (pixbuf);
-      image_data->height = gdk_pixbuf_get_height (pixbuf);
+      image_data->pattern = pixbuf ? goo_canvas_cairo_pattern_from_pixbuf (pixbuf) : NULL;
+      image_data->width = pixbuf ? gdk_pixbuf_get_width (pixbuf) : 0;
+      image_data->height = pixbuf ? gdk_pixbuf_get_height (pixbuf) : 0;
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);

Index: goocanvasitem.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasitem.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- goocanvasitem.c	13 Aug 2007 11:18:23 -0000	1.32
+++ goocanvasitem.c	13 Nov 2007 14:30:52 -0000	1.33
@@ -507,6 +507,7 @@
   GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item);
 
   g_return_if_fail (iface->add_child != NULL);
+  g_return_if_fail (item != child);
 
   iface->add_child (item, child, position);
 }

Index: goocanvasitemmodel.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasitemmodel.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- goocanvasitemmodel.c	25 Apr 2007 13:24:38 -0000	1.15
+++ goocanvasitemmodel.c	13 Nov 2007 14:30:52 -0000	1.16
@@ -274,6 +274,7 @@
   GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model);
 
   g_return_if_fail (iface->add_child != NULL);
+  g_return_if_fail (model != child);
 
   iface->add_child (model, child, position);
 }



More information about the cairo-commit mailing list