# HG changeset patch # User Thinker K.F. Li # Date 1218364072 -28800 # Node ID e444a8c01735018ac554b6a7fa14f42d60606efb # Parent 01ed2bc37eeddc28101be3f46c598dcb3be715f4 Change interface of paint_radial_new() diff -r 01ed2bc37eed -r e444a8c01735 src/X_main.c --- a/src/X_main.c Sun Aug 10 16:44:21 2008 +0800 +++ b/src/X_main.c Sun Aug 10 18:27:52 2008 +0800 @@ -157,9 +157,10 @@ face = cairo_get_font_face(tmpcr); text = sh_text_new("hello \xe6\xbc\xa2\xe5\xad\x97", 10, h / 4, 36.0, face); + text_fill = paint_radial_new(&rdman, 100, h / 4, 70); grad_stop_init(text_stops, 0, 0.2, 0.9, 0.2, 1); grad_stop_init(text_stops + 1, 1, 0.9, 0.2, 0.2, 0.1); - text_fill = paint_radial_new(&rdman, 100, h / 4, 70, 2, text_stops); + paint_radial_stops(text_fill, 2, text_stops); rdman_paint_stroke(&rdman, text_stroke, text); text->stroke_width = 0.5; rdman_paint_fill(&rdman, text_fill, text); diff -r 01ed2bc37eed -r e444a8c01735 src/paint.c --- a/src/paint.c Sun Aug 10 16:44:21 2008 +0800 +++ b/src/paint.c Sun Aug 10 18:27:52 2008 +0800 @@ -197,8 +197,7 @@ } paint_t *paint_radial_new(redraw_man_t *rdman, - co_aix cx, co_aix cy, co_aix r, - int n_stops, grad_stop_t *stops) { + co_aix cx, co_aix cy, co_aix r) { paint_radial_t *radial; radial = O_ALLOC(paint_radial_t); @@ -209,8 +208,8 @@ radial->cx = cx; radial->cy = cy; radial->r = r; - radial->n_stops = n_stops; - radial->stops = stops; + radial->n_stops = 0; + radial->stops = NULL; radial->flags = RDF_DIRTY; radial->ptn = NULL; diff -r 01ed2bc37eed -r e444a8c01735 src/paint.h --- a/src/paint.h Sun Aug 10 16:44:21 2008 +0800 +++ b/src/paint.h Sun Aug 10 18:27:52 2008 +0800 @@ -36,8 +36,7 @@ int n_stops, grad_stop_t *stops); extern paint_t *paint_radial_new(redraw_man_t *rdman, - co_aix cx, co_aix cy, co_aix r, - int n_stops, grad_stop_t *stops); + co_aix cx, co_aix cy, co_aix r); extern grad_stop_t *paint_radial_stops(paint_t *paint, int n_stops, grad_stop_t *stops);