[PATCH] Make the gradient code match the image

Nis Martensen nis.martensen at web.de
Sat Sep 15 01:49:38 PDT 2007


---
 src/tutorial.mdwn      |    4 ++--
 src/tutorial/diagram.c |    8 ++++----
 src/tutorial/mask.c    |    4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/tutorial.mdwn b/src/tutorial.mdwn
index 2d6fbd3..b97e51d 100644
--- a/src/tutorial.mdwn
+++ b/src/tutorial.mdwn
@@ -246,9 +246,9 @@ pattern or surface is transparent, nothing is transferred.
 	cairo_pattern_add_color_stop_rgb (linpat, 0, 0, 0.3, 0.8);
 	cairo_pattern_add_color_stop_rgb (linpat, 1, 0, 0.8, 0.3);
 
-	radpat = cairo_pattern_create_radial (0.5, 0.5, 0.25, 0.5, 0.5, 0.5);
+	radpat = cairo_pattern_create_radial (0.5, 0.5, 0.25, 0.5, 0.5, 0.6);
 	cairo_pattern_add_color_stop_rgba (radpat, 0, 0, 0, 0, 1);
-	cairo_pattern_add_color_stop_rgba (radpat, 0.5, 0, 0, 0, 0);
+	cairo_pattern_add_color_stop_rgba (radpat, 1, 0, 0, 0, 0);
 
 	cairo_set_source (cr, linpat);
 	cairo_mask (cr, radpat);
diff --git a/src/tutorial/diagram.c b/src/tutorial/diagram.c
index c9cb004..a9432e7 100644
--- a/src/tutorial/diagram.c
+++ b/src/tutorial/diagram.c
@@ -432,9 +432,9 @@ void mask_draw_mask (cairo_t *cr)
 {
 	cairo_pattern_t *radialinv;
 
-	radialinv = cairo_pattern_create_radial (0.5, 0.5, 0.25, 0.5, 0.5, 0.5);
+	radialinv = cairo_pattern_create_radial (0.5, 0.5, 0.25, 0.5, 0.5, 0.6);
 	cairo_pattern_add_color_stop_rgba (radialinv, 0, 0, 0, 0, 0);
-	cairo_pattern_add_color_stop_rgba (radialinv, 0.5, 0, 0, 0, 1);
+	cairo_pattern_add_color_stop_rgba (radialinv, 1, 0, 0, 0, 1);
 
 	cairo_save (cr);
 	cairo_rectangle (cr, 0, 0, 1, 1);
@@ -450,9 +450,9 @@ void mask_draw_dest (cairo_t *cr)
 	cairo_pattern_add_color_stop_rgb (linpat, 0, 0, 0.3, 0.8);
 	cairo_pattern_add_color_stop_rgb (linpat, 1, 0, 0.8, 0.3);
 
-	radpat = cairo_pattern_create_radial (0.5, 0.5, 0.25, 0.5, 0.5, 0.5);
+	radpat = cairo_pattern_create_radial (0.5, 0.5, 0.25, 0.5, 0.5, 0.6);
 	cairo_pattern_add_color_stop_rgba (radpat, 0, 0, 0, 0, 1);
-	cairo_pattern_add_color_stop_rgba (radpat, 0.5, 0, 0, 0, 0);
+	cairo_pattern_add_color_stop_rgba (radpat, 1, 0, 0, 0, 0);
 
 	diagram_draw_dest (cr);
 	cairo_save (cr);
diff --git a/src/tutorial/mask.c b/src/tutorial/mask.c
index 30a8ff8..2a9e152 100644
--- a/src/tutorial/mask.c
+++ b/src/tutorial/mask.c
@@ -17,9 +17,9 @@ main (int argc, char *argv[])
 	cairo_pattern_add_color_stop_rgb (linpat, 0, 0, 0.3, 0.8);
 	cairo_pattern_add_color_stop_rgb (linpat, 1, 0, 0.8, 0.3);
 
-	radpat = cairo_pattern_create_radial (0.5, 0.5, 0.25, 0.5, 0.5, 0.5);
+	radpat = cairo_pattern_create_radial (0.5, 0.5, 0.25, 0.5, 0.5, 0.6);
 	cairo_pattern_add_color_stop_rgba (radpat, 0, 0, 0, 0, 1);
-	cairo_pattern_add_color_stop_rgba (radpat, 0.5, 0, 0, 0, 0);
+	cairo_pattern_add_color_stop_rgba (radpat, 1, 0, 0, 0, 0);
 
 	cairo_set_source (cr, linpat);
 	cairo_pattern_destroy (linpat);
-- 
1.5.3


--HlL+5n6rz5pIUxbD--


More information about the cairo mailing list