raphael.js close path
I have a problem in closing a path with raphael.js.
Here is my path: M 5 120 A 50,50 0 0,1 18,71 M 18 71 A 50,50 0 0,1 85,93 M 85 93 A 50,50 0 0,1 173,78 M 173 78 A 50,50 0 0,1 213,90 M 213 90 A 50,50 0 0,1 315, 120z
Inst开发者_JAVA百科ead of closing the whole path only the last arc get closed while i want that the whole path get closed with a line to the first point.
any idea?
The M command moves the path to a new point (e.g. M 18 17 moves to position (18,17)), and starts a new section of the drawing. You can remove all the M commands in your path except the first one as they just move to the point where the path already is (notice the two numbers before an M are the same as the two numbers after it).
Then you should have what you want - a single path that closes properly:
M 5 120 A 50,50 0 0,1 18,71 A 50,50 0 0,1 85,93 A 50,50 0 0,1 173,78 A 50,50 0 0,1 213,90 A 50,50 0 0,1 315, 120z
精彩评论