Mercurial > MadButterfly
comparison src/X_main.c @ 11:128af06c876c
Fix the bug that data of a path end with white spaces would make system down
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Sat, 26 Jul 2008 06:34:15 +0800 |
parents | 7cfecdce94cc |
children | 79e9edf4c00a |
comparison
equal
deleted
inserted
replaced
10:7cfecdce94cc | 11:128af06c876c |
---|---|
10 | 10 |
11 void draw_path(cairo_t *cr, int w, int h) { | 11 void draw_path(cairo_t *cr, int w, int h) { |
12 shape_t *path; | 12 shape_t *path; |
13 coord_t coord; | 13 coord_t coord; |
14 | 14 |
15 path = sh_path_new("m80 80 c 20 5 -30 20 10 30 t -30 0 z"); | 15 path = sh_path_new("M 22,89.36218 C -34,-0.63782 39,-9.637817 82,12.36218 C 125,34.36218 142,136.36218 142,136.36218 C 100.66667,125.36218 74.26756,123.42795 22,89.36218 z "); |
16 memset(coord.aggr_matrix, 0, sizeof(co_aix) * 6); | 16 memset(coord.aggr_matrix, 0, sizeof(co_aix) * 6); |
17 coord.aggr_matrix[0] = 1; | 17 coord.aggr_matrix[0] = 0.8; |
18 coord.aggr_matrix[1] = 0.5; | 18 coord.aggr_matrix[1] = 0; |
19 coord.aggr_matrix[2] = -30; | 19 coord.aggr_matrix[2] = 20; |
20 coord.aggr_matrix[4] = 1; | 20 coord.aggr_matrix[4] = 0.8; |
21 coord.aggr_matrix[5] = -20; | 21 coord.aggr_matrix[5] = 20; |
22 sh_path_transform(path, &coord); | 22 sh_path_transform(path, &coord); |
23 sh_path_draw(path, cr); | 23 sh_path_draw(path, cr); |
24 } | 24 } |
25 | 25 |
26 void drawing(cairo_surface_t *surface, int w, int h) { | 26 void drawing(cairo_surface_t *surface, int w, int h) { |