[cairo-commit] goocanvas/src goocanvasstyle.c,1.6,1.7

Damon Chaplin commit at pdx.freedesktop.org
Wed Mar 28 03:06:51 PDT 2007


Committed by: damon

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

Modified Files:
	goocanvasstyle.c 
Log Message:
2007-03-28  Damon Chaplin  <damon at gnome.org>

	* src/goocanvasstyle.c (goo_canvas_style_set_fill_options): check if
	the fill pattern is set to NULL, which is used to reset any fill
	pattern or color. If it is, don't set the cairo source and return
	FALSE.

	* demo/demo.c (move_ellipse_clicked): set the fill pattern to NULL
	occasionally to test the above.



Index: goocanvasstyle.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasstyle.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- goocanvasstyle.c	25 Feb 2007 18:25:52 -0000	1.6
+++ goocanvasstyle.c	28 Mar 2007 10:06:43 -0000	1.7
@@ -492,6 +492,7 @@
   GooCanvasStyleProperty *property;
   gboolean operator_set = FALSE, antialias_set = FALSE;
   gboolean fill_rule_set = FALSE, fill_pattern_set = FALSE;
+  gboolean need_fill = FALSE;
   gint i;
 
   if (!style)
@@ -522,7 +523,11 @@
 	    }
 	  else if (property->id == goo_canvas_style_fill_pattern_id && !fill_pattern_set)
 	    {
-	      cairo_set_source (cr, property->value.data[0].v_pointer);
+	      if (property->value.data[0].v_pointer)
+		{
+		  cairo_set_source (cr, property->value.data[0].v_pointer);
+		  need_fill = TRUE;
+		}
 	      fill_pattern_set = TRUE;
 	    }
 	}
@@ -530,5 +535,5 @@
       style = style->parent;
     }
 
-  return fill_pattern_set;
+  return need_fill;
 }



More information about the cairo-commit mailing list