# HG changeset patch # User Thinker K.F. Li # Date 1281700216 -28800 # Node ID da794f4fe96c3e310463351415e46c7a69e99055 # Parent c93381320d6e84eae0862fd29efd40318bfe34b3 save and restore initial point at m and z commands of path diff -r c93381320d6e -r da794f4fe96c src/shape_path.c --- a/src/shape_path.c Fri Aug 13 18:23:44 2010 +0800 +++ b/src/shape_path.c Fri Aug 13 19:50:16 2010 +0800 @@ -570,6 +570,7 @@ char cmd; co_aix *pnts; co_aix *float_args; + co_aix sx = 0, sy = 0; co_aix x, y; int r; @@ -684,8 +685,37 @@ *cmds++ = toupper(cmd); } break; + case 'm': case 'M': + while(*p) { + old = p; + SKIP_SPACE(p); + old = p; + SKIP_NUM(p); + if(p == old) + break; + *pnts = TO_ABSX; + x = *pnts; + pnts++; + + SKIP_SPACE(p); + old = p; + SKIP_NUM(p); + if(p == old) + return ERR; + *pnts = TO_ABSY; + y = *pnts; + pnts++; + + *cmds++ = toupper(cmd); + + /* save initial point of a subpath */ + sx = x; + sy = y; + } + break; + case 'l': case 'L': case 't': @@ -732,6 +762,9 @@ case 'z': case 'Z': *cmds++ = toupper(cmd); + /* Go back to initial point of a subpath */ + x = sx; + y = sy; break; default: return ERR;