# HG changeset patch # User Thinker K.F. Li # Date 1217011260 -28800 # Node ID 772511b8b9be237d7a64c0900382b84e4cd91fed # Parent 9c331ec9e210071473f3fa11d28fb0fa86e54900 Cairo specify RGB values in range 0.0 ~ 1.0. diff -r 9c331ec9e210 -r 772511b8b9be src/X_main.c --- a/src/X_main.c Sat Jul 26 01:37:35 2008 +0800 +++ b/src/X_main.c Sat Jul 26 02:41:00 2008 +0800 @@ -1,6 +1,7 @@ #include #include #include +#include #include #include @@ -15,7 +16,7 @@ coord.aggr_matrix[0] = 1; coord.aggr_matrix[1] = 0.5; coord.aggr_matrix[4] = 1; - coord.aggr_matrix[5] = 0.5; + coord.aggr_matrix[5] = 0; sh_path_transform(path, &coord); sh_path_draw(path, cr); } @@ -24,12 +25,13 @@ cairo_t *cr; cr = cairo_create(surface); - cairo_set_source_rgb(cr, 0xff, 0xff, 0x80); + cairo_set_source_rgb(cr, 0.9, 0.1, 0.1); draw_path(cr, w, h); + cairo_set_source_rgb(cr, 0.5, 0.9, 0.8); cairo_move_to(cr, 10, h / 2); cairo_set_font_size(cr, 48.0); cairo_text_path(cr, "hello \xe4\xb8\xad\xe6\x96\x87"); - cairo_set_line_width(cr, 1); + cairo_set_line_width(cr, 2); cairo_stroke(cr); } diff -r 9c331ec9e210 -r 772511b8b9be src/shape_path.c --- a/src/shape_path.c Sat Jul 26 01:37:35 2008 +0800 +++ b/src/shape_path.c Sat Jul 26 02:41:00 2008 +0800 @@ -186,6 +186,7 @@ while(*p) { SKIP_SPACE(p); + /* TODO: transform all relative to absolute, */ *cmds++ = *p; switch(*p++) { case 'c': @@ -486,6 +487,8 @@ break; } } + + cairo_fill(cr); } #ifdef UNITTEST