comparison src/X_main.c @ 7:569f3168ba53

Clear background & tranform relative pos into absolute ones
author Thinker K.F. Li <thinker@branda.to>
date Sat, 26 Jul 2008 02:53:08 +0800
parents 772511b8b9be
children 94b4b5bd8810
comparison
equal deleted inserted replaced
6:772511b8b9be 7:569f3168ba53
13 13
14 path = sh_path_new("M80 80 c 20 5 -30 20 10 30 l -30 0 z"); 14 path = sh_path_new("M80 80 c 20 5 -30 20 10 30 l -30 0 z");
15 memset(coord.aggr_matrix, 0, sizeof(co_aix) * 6); 15 memset(coord.aggr_matrix, 0, sizeof(co_aix) * 6);
16 coord.aggr_matrix[0] = 1; 16 coord.aggr_matrix[0] = 1;
17 coord.aggr_matrix[1] = 0.5; 17 coord.aggr_matrix[1] = 0.5;
18 coord.aggr_matrix[2] = -30;
18 coord.aggr_matrix[4] = 1; 19 coord.aggr_matrix[4] = 1;
19 coord.aggr_matrix[5] = 0; 20 coord.aggr_matrix[5] = -20;
20 sh_path_transform(path, &coord); 21 sh_path_transform(path, &coord);
21 sh_path_draw(path, cr); 22 sh_path_draw(path, cr);
22 } 23 }
23 24
24 void drawing(cairo_surface_t *surface, int w, int h) { 25 void drawing(cairo_surface_t *surface, int w, int h) {
25 cairo_t *cr; 26 cairo_t *cr;
26 27
27 cr = cairo_create(surface); 28 cr = cairo_create(surface);
29 cairo_set_source_rgb(cr, 0, 0, 0);
30 cairo_paint(cr);
28 cairo_set_source_rgb(cr, 0.9, 0.1, 0.1); 31 cairo_set_source_rgb(cr, 0.9, 0.1, 0.1);
29 draw_path(cr, w, h); 32 draw_path(cr, w, h);
30 cairo_set_source_rgb(cr, 0.5, 0.9, 0.8); 33 cairo_set_source_rgb(cr, 0.5, 0.9, 0.8);
31 cairo_move_to(cr, 10, h / 2); 34 cairo_move_to(cr, 10, h / 2);
32 cairo_set_font_size(cr, 48.0); 35 cairo_set_font_size(cr, 48.0);