[cairo-commit] pycairo/examples/cairo_snippets/snippets gradient.py, 1.2, 1.3 imagepattern.py, 1.2, 1.3

Steve Chaplin commit at pdx.freedesktop.org
Mon Aug 29 07:52:32 PDT 2005


Committed by: stevech1097

Update of /cvs/cairo/pycairo/examples/cairo_snippets/snippets
In directory gabe:/tmp/cvs-serv22702/examples/cairo_snippets/snippets

Modified Files:
	gradient.py imagepattern.py 
Log Message:
'SC'

Index: gradient.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/cairo_snippets/snippets/gradient.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- gradient.py	15 Apr 2005 06:53:05 -0000	1.2
+++ gradient.py	29 Aug 2005 14:52:30 -0000	1.3
@@ -1,14 +1,14 @@
 snippet_normalize (cr, width, height)
 
-pat = cairo.Pattern.create_linear (0.0, 0.0,  0.0, 1.0)
+pat = cairo.LinearGradient (0.0, 0.0,  0.0, 1.0)
 pat.add_color_stop_rgba (1, 0, 0, 0, 1)
 pat.add_color_stop_rgba (0, 1, 1, 1, 1)
 cr.rectangle (0,0,1,1)
 cr.set_source (pat)
 cr.fill ()
 
-pat = cairo.Pattern.create_radial (0.45, 0.4, 0.1,
-                                   0.4,  0.4, 0.5)
+pat = cairo.RadialGradient (0.45, 0.4, 0.1,
+                            0.4,  0.4, 0.5)
 pat.add_color_stop_rgba (0, 1, 1, 1, 1)
 pat.add_color_stop_rgba (1, 0, 0, 0, 1)
 cr.set_source (pat)

Index: imagepattern.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/cairo_snippets/snippets/imagepattern.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- imagepattern.py	19 May 2005 04:47:56 -0000	1.2
+++ imagepattern.py	29 Aug 2005 14:52:30 -0000	1.3
@@ -6,7 +6,7 @@
 w = image.get_width()
 h = image.get_height()
 
-pattern = cairo.Pattern.create_for_surface (image)
+pattern = cairo.SurfacePattern (image)
 pattern.set_extend (cairo.EXTEND_REPEAT)
 
 cr.translate (0.5, 0.5)
@@ -14,7 +14,7 @@
 cr.scale (1 / math.sqrt (2), 1 / math.sqrt (2))
 cr.translate (- 0.5, - 0.5)
 
-matrix = cairo.Matrix(xx=w * 5, yy=h * 5) 
+matrix = cairo.Matrix(xx=w * 5, yy=h * 5)
 pattern.set_matrix (matrix)
 
 cr.set_source (pattern)



More information about the cairo-commit mailing list