1 | import { NUM_DEFAULT } from './constants';
|
2 |
|
3 | export default function ellipse2path(options){
|
4 | var cx = options.cx || NUM_DEFAULT,
|
5 | cy = options.cy || NUM_DEFAULT,
|
6 | rx = options.rx || NUM_DEFAULT,
|
7 | ry = options.ry || NUM_DEFAULT;
|
8 |
|
9 | return "M" + (cx - rx) + "," + cy + " a" + rx + "," + ry + " 0 1,0 " + (rx * 2) + ",0 a" + rx + "," + ry + " 0 1,0 -" + (rx * 2) + ",0";
|
10 | }
|