# HG changeset patch # User Thinker K.F. Li # Date 1220969837 -28800 # Node ID 4aa1c96733639baa8238a2f390a42cc9981ddfa4 # Parent 688f76b8e71cfab5ac2157985a43cb1c697c6e22 Arc in path pass the test in example svg2code_ex. diff -r 688f76b8e71c -r 4aa1c9673363 examples/svg2code_ex/svg2code_ex.svg --- a/examples/svg2code_ex/svg2code_ex.svg Tue Sep 09 18:11:37 2008 +0800 +++ b/examples/svg2code_ex/svg2code_ex.svg Tue Sep 09 22:17:17 2008 +0800 @@ -2,7 +2,7 @@ + @@ -315,14 +322,14 @@ inkscape:pageshadow="2" inkscape:zoom="0.63166667" inkscape:cx="400" - inkscape:cy="302.75296" + inkscape:cy="176.10388" inkscape:document-units="px" inkscape:current-layer="layer1" width="800px" height="600px" showgrid="true" inkscape:window-width="822" - inkscape:window-height="609" + inkscape:window-height="695" inkscape:window-x="130" inkscape:window-y="120" /> test + diff -r 688f76b8e71c -r 4aa1c9673363 src/shape_path.c --- a/src/shape_path.c Tue Sep 09 18:11:37 2008 +0800 +++ b/src/shape_path.c Tue Sep 09 22:17:17 2008 +0800 @@ -172,7 +172,7 @@ SKIP_NUM(p); if(p == old) break; - TAKE_NUM(rx); + rx = atof(old); TAKE_NUM(ry); TAKE_NUM(x_rotate); @@ -243,11 +243,11 @@ sweep = *fix_args++; dx = x - cx; - dy = y = cy; + dy = y - cy; dx0 = x0 - cx; dy0 = y0 - cy; dxx = xx - cx; - dxy = xy = cy; + dxy = xy - cy; rx2 = dxx * dxx + dxy * dxy; rx = sqrtf(rx2); @@ -264,15 +264,15 @@ if(xyratio < 0) xyratio = -xyratio; - angle0 = acos(inner / rx2); + angle0 = acos(inner0 / rx2); if(cross0 < 0) - angle0 += PI; /* 3rd, 4th Quadrant */ + angle0 = PI * 2 - angle0; /* 3rd, 4th Quadrant */ inner = INNER(dx, dy, dxx, dxy); cross = CROSS(dx, dy, dxx, dxy); angle = acos(inner / rx2); if(cross < 0) - angle += PI; /* 3rd, 4th Quadrant */ + angle = PI * 2 - angle; /* 3rd, 4th Quadrant */ /* Make a path for arc */ rotate = acos(dxx / rx);