# HG changeset patch # User Thinker K.F. Li # Date 1219392893 -28800 # Node ID 7d0580f89468b07ecb2e8e14e9db1c8dc1f76e85 # Parent 9b4a02bcaeb1d44a1abfda13991e5aab4383411e Fix bug of dealing matrix(). diff -r 9b4a02bcaeb1 -r 7d0580f89468 src/shape_path.c --- a/src/shape_path.c Fri Aug 22 15:47:03 2008 +0800 +++ b/src/shape_path.c Fri Aug 22 16:14:53 2008 +0800 @@ -46,6 +46,10 @@ free(path); } +/*! \brief Count number of arguments. + * + * \todo Notify programmers that syntax or value error of path data. + */ static int sh_path_cmd_arg_cnt(char *data, int *cmd_cntp, int *arg_cntp) { char *p, *old; int cmd_cnt, arg_cnt; diff -r 9b4a02bcaeb1 -r 7d0580f89468 tools/svg2code.py --- a/tools/svg2code.py Fri Aug 22 15:47:03 2008 +0800 +++ b/tools/svg2code.py Fri Aug 22 16:14:53 2008 +0800 @@ -24,6 +24,10 @@ r = float(int(color[1:3], 16)) / 255.0 g = float(int(color[3:5], 16)) / 255.0 b = float(int(color[5:7], 16)) / 255.0 + elif color.lower() == 'white': + r, g, b = 1, 1, 1 + elif color.lower() == 'black': + r, g, b = 0, 0, 0 else: mo = re_rgb.match(color) if mo: @@ -34,7 +38,11 @@ raise ValueError, '\'%s\' is invalid color value.' % (color) pass - opacity = style_map['stop-opacity'] + try: + opacity = style_map['stop-opacity'] + except: + opacity = 1 + pass offset = node.getAttribute('offset') stops.append('[COLOR_STOP([%s], %f, %f, %f, %f, %f)]' % ( parent_id, r, g, b, float(opacity), float(offset))) @@ -136,6 +144,8 @@ paint_id = fill[5:-1] print >> codefo, 'FILL_SHAPE_WITH_PAINT([%s], [%s])dnl' % ( node_id, paint_id) + elif fill.lower() == 'none': + pass else: raise ValueError, '\'%s\' is an invalid value for fill.' % (fill) pass @@ -286,7 +296,6 @@ if not mo: return name = mo.group(1) - print name if name == 'translate': mo = reo_translate.match(transform) if mo: