# HG changeset patch # User Thinker K.F. Li # Date 1217013649 -28800 # Node ID 94b4b5bd88104d052e08f2eb121b432a7cf2a5dd # Parent 569f3168ba53c569cd6631dee3e3129917b69d9a - diff -r 569f3168ba53 -r 94b4b5bd8810 src/X_main.c --- a/src/X_main.c Sat Jul 26 02:53:08 2008 +0800 +++ b/src/X_main.c Sat Jul 26 03:20:49 2008 +0800 @@ -11,7 +11,7 @@ shape_t *path; coord_t coord; - path = sh_path_new("M80 80 c 20 5 -30 20 10 30 l -30 0 z"); + path = sh_path_new("m80 80 c 20 5 -30 20 10 30 l -30 0 z"); memset(coord.aggr_matrix, 0, sizeof(co_aix) * 6); coord.aggr_matrix[0] = 1; coord.aggr_matrix[1] = 0.5; diff -r 569f3168ba53 -r 94b4b5bd8810 src/shape_path.c --- a/src/shape_path.c Sat Jul 26 02:53:08 2008 +0800 +++ b/src/shape_path.c Sat Jul 26 03:20:49 2008 +0800 @@ -5,6 +5,12 @@ #include #include "mb_types.h" +/*! \brief Implement respective objects for SVG path tag. + * + * In user_data or dev_data, 0x00 bytes are padding after commands. + * No commands other than 0x00 can resident after 0x00 itself. + * It means command processing code can skip commands after a 0x00. + */ typedef struct _sh_path { shape_t shape; int cmd_len; @@ -320,6 +326,11 @@ if(r == ERR) return NULL; + /* Align at 4's boundary and keep 2 unused co_aix space + * to make logic of transformation from relative to absolute + * simple. + */ + cmd_cnt += sizeof(co_aix) * 2; cmd_cnt = (cmd_cnt + 3) & ~0x3; path = (sh_path_t *)malloc(sizeof(sh_path_t)); @@ -485,6 +496,7 @@ cairo_close_path(cr); break; case '\x0': + i = cmd_len; /* padding! Skip remain ones. */ break; } }