[cairo-commit] pycairo/examples/cairo_snippets/snippets
curve_rectangle.py, 1.1, 1.2 curve_to.py, 1.1,
1.2 fill_and_stroke.py, 1.1, 1.2 fill_and_stroke2.py, 1.1,
1.2 gradient.py, 1.1, 1.2 set_line_cap.py, 1.1, 1.2 text.py,
1.2, 1.3 text_align_center.py, 1.2, 1.3 text_extents.py, 1.2, 1.3
Steve Chaplin
commit at pdx.freedesktop.org
Thu Apr 14 23:53:07 PDT 2005
Committed by: stevech1097
Update of /cvs/cairo/pycairo/examples/cairo_snippets/snippets
In directory gabe:/tmp/cvs-serv5956/examples/cairo_snippets/snippets
Modified Files:
curve_rectangle.py curve_to.py fill_and_stroke.py
fill_and_stroke2.py gradient.py set_line_cap.py text.py
text_align_center.py text_extents.py
Log Message:
SC 2005/04/15
Index: curve_rectangle.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/cairo_snippets/snippets/curve_rectangle.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- curve_rectangle.py 6 Apr 2005 13:54:10 -0000 1.1
+++ curve_rectangle.py 15 Apr 2005 06:53:05 -0000 1.2
@@ -49,9 +49,8 @@
#/* and fill/stroke it */
cr.save ()
-cr.set_rgb_color (0.5,0.5,1)
+cr.set_source_rgb (0.5,0.5,1)
cr.fill ()
cr.restore ()
-cr.set_alpha (0.5)
-cr.set_rgb_color (0.5, 0,0)
+cr.set_source_rgba (0.5, 0,0,0.5)
cr.stroke ()
Index: curve_to.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/cairo_snippets/snippets/curve_to.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- curve_to.py 6 Apr 2005 13:54:10 -0000 1.1
+++ curve_to.py 15 Apr 2005 06:53:05 -0000 1.2
@@ -10,8 +10,7 @@
cr.stroke ()
-cr.set_rgb_color (1,0.2,0.2)
-cr.set_alpha (0.6)
+cr.set_source_rgba (1,0.2,0.2,0.6)
cr.set_line_width (0.03)
cr.move_to (x,y); cr.line_to (x1,y1)
cr.move_to (x2,y2); cr.line_to (x3,y3)
Index: fill_and_stroke.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/cairo_snippets/snippets/fill_and_stroke.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- fill_and_stroke.py 6 Apr 2005 13:54:10 -0000 1.1
+++ fill_and_stroke.py 15 Apr 2005 06:53:05 -0000 1.2
@@ -6,7 +6,7 @@
cr.curve_to (0.2, 0.9, 0.2, 0.5, 0.5, 0.5)
cr.save ()
-cr.set_rgb_color (0, 0, 1)
+cr.set_source_rgb (0, 0, 1)
cr.fill ()
cr.restore ()
Index: fill_and_stroke2.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/cairo_snippets/snippets/fill_and_stroke2.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- fill_and_stroke2.py 6 Apr 2005 13:54:10 -0000 1.1
+++ fill_and_stroke2.py 15 Apr 2005 06:53:05 -0000 1.2
@@ -14,7 +14,7 @@
cr.save ()
-cr.set_rgb_color (0, 0, 1)
+cr.set_source_rgb (0, 0, 1)
cr.fill ()
cr.restore ()
Index: gradient.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/cairo_snippets/snippets/gradient.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- gradient.py 6 Apr 2005 13:54:10 -0000 1.1
+++ gradient.py 15 Apr 2005 06:53:05 -0000 1.2
@@ -1,16 +1,16 @@
snippet_normalize (cr, width, height)
pat = cairo.Pattern.create_linear (0.0, 0.0, 0.0, 1.0)
-pat.add_color_stop (1, 0, 0, 0, 1)
-pat.add_color_stop (0, 1, 1, 1, 1)
+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_pattern (pat)
+cr.set_source (pat)
cr.fill ()
pat = cairo.Pattern.create_radial (0.45, 0.4, 0.1,
0.4, 0.4, 0.5)
-pat.add_color_stop (0, 1, 1, 1, 1)
-pat.add_color_stop (1, 0, 0, 0, 1)
-cr.set_pattern (pat)
+pat.add_color_stop_rgba (0, 1, 1, 1, 1)
+pat.add_color_stop_rgba (1, 0, 0, 0, 1)
+cr.set_source (pat)
cr.arc (0.5, 0.5, 0.3, 0, 2 * M_PI)
cr.fill ()
Index: set_line_cap.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/cairo_snippets/snippets/set_line_cap.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- set_line_cap.py 6 Apr 2005 13:54:10 -0000 1.1
+++ set_line_cap.py 15 Apr 2005 06:53:05 -0000 1.2
@@ -11,7 +11,7 @@
cr.stroke ()
#/* draw helping lines */
-cr.set_rgb_color (1,0.2,0.2)
+cr.set_source_rgb (1,0.2,0.2)
cr.set_line_width (0.01)
cr.move_to (0.25, 0.2); cr.line_to (0.25, 0.8)
cr.move_to (0.5, 0.2); cr.line_to (0.5, 0.8)
Index: text.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/cairo_snippets/snippets/text.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- text.py 12 Apr 2005 02:41:23 -0000 1.2
+++ text.py 15 Apr 2005 06:53:05 -0000 1.3
@@ -1,6 +1,6 @@
snippet_normalize (cr, width, height)
cr.select_font_face ("Sans", cairo.FONT_SLANT_NORMAL,
- cairo.FONT_WEIGHT_BOLD)
+ cairo.FONT_WEIGHT_BOLD)
cr.set_font_size (0.35)
cr.move_to (0.04, 0.53)
@@ -9,15 +9,14 @@
cr.move_to (0.27, 0.65)
cr.text_path ("void")
cr.save ()
-cr.set_rgb_color (0.5,0.5,1)
+cr.set_source_rgb (0.5,0.5,1)
cr.fill ()
cr.restore ()
cr.set_line_width (0.01)
cr.stroke ()
#/* draw helping lines */
-cr.set_rgb_color (1,0.2,0.2)
-cr.set_alpha (0.6)
+cr.set_source_rgba (1,0.2,0.2, 0.6)
cr.arc (0.04, 0.53, 0.02, 0, 2*M_PI)
cr.arc (0.27, 0.65, 0.02, 0, 2*M_PI)
cr.fill ()
Index: text_align_center.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/cairo_snippets/snippets/text_align_center.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- text_align_center.py 12 Apr 2005 02:41:23 -0000 1.2
+++ text_align_center.py 15 Apr 2005 06:53:05 -0000 1.3
@@ -15,8 +15,7 @@
cr.show_text (utf8)
#/* draw helping lines */
-cr.set_rgb_color (1,0.2,0.2)
-cr.set_alpha (0.6)
+cr.set_source_rgba (1,0.2,0.2,0.6)
cr.arc (x, y, 0.05, 0, 2*M_PI)
cr.fill ()
cr.move_to (0.5, 0)
Index: text_extents.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/cairo_snippets/snippets/text_extents.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- text_extents.py 12 Apr 2005 02:41:23 -0000 1.2
+++ text_extents.py 15 Apr 2005 06:53:05 -0000 1.3
@@ -16,8 +16,7 @@
cr.show_text (utf8)
#/* draw helping lines */
-cr.set_rgb_color (1,0.2,0.2)
-cr.set_alpha (0.6)
+cr.set_source_rgba (1,0.2,0.2,0.6)
cr.arc (x, y, 0.05, 0, 2*M_PI)
cr.fill ()
cr.move_to (x,y)
More information about the cairo-commit
mailing list