[cairo-commit] rcairo/packages/cairo/ext rb_cairo_pattern.c, 1.11, 1.12

Kouhei Sutou commit at pdx.freedesktop.org
Mon Oct 10 18:59:09 PDT 2005


Committed by: kou

Update of /cvs/cairo/rcairo/packages/cairo/ext
In directory gabe:/tmp/cvs-serv12251/packages/cairo/ext

Modified Files:
	rb_cairo_pattern.c 
Log Message:
* packages/cairo/ext/rb_cairo_pattern.c
  (cr_gradient_pattern_add_color_stop_rgba): Renamed from
  cr_gradient_pattern_add_color_stop.


Index: rb_cairo_pattern.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/rb_cairo_pattern.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- rb_cairo_pattern.c	10 Oct 2005 19:30:40 -0000	1.11
+++ rb_cairo_pattern.c	11 Oct 2005 01:59:07 -0000	1.12
@@ -168,7 +168,7 @@
 
 /* Cairo::GradientPattern */
 static VALUE
-cr_gradient_pattern_add_color_stop (int argc, VALUE *argv, VALUE self)
+cr_gradient_pattern_add_color_stop_rgba (int argc, VALUE *argv, VALUE self)
 {
   VALUE offset, red, green, blue, alpha;
   int n;
@@ -187,7 +187,7 @@
       alpha = rb_ary_entry (ary, 3);
     }
 
-  if (n == 4)
+  if (n == 4 || (n == 5 && NIL_P (alpha)))
     {
       cairo_pattern_add_color_stop_rgb (_SELF (self), NUM2DBL (offset),
                                         NUM2DBL (red), NUM2DBL (green),
@@ -315,8 +315,8 @@
   rb_cCairo_GradientPattern =
     rb_define_class_under (rb_mCairo, "GradientPattern", rb_cCairo_Pattern);
 
-  rb_define_method (rb_cCairo_GradientPattern, "add_color_stop",
-                    cr_gradient_pattern_add_color_stop, -1);
+  rb_define_method (rb_cCairo_GradientPattern, "add_color_stop_rgba",
+                    cr_gradient_pattern_add_color_stop_rgba, -1);
 
   rb_cCairo_LinearPattern =
     rb_define_class_under (rb_mCairo, "LinearPattern",



More information about the cairo-commit mailing list