1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
| var Path = require("../Path");
|
| /**
| * 圆环
| * @module zrender/graphic/shape/Ring
| */
| var _default = Path.extend({
| type: 'ring',
| shape: {
| cx: 0,
| cy: 0,
| r: 0,
| r0: 0
| },
| buildPath: function (ctx, shape) {
| var x = shape.cx;
| var y = shape.cy;
| var PI2 = Math.PI * 2;
| ctx.moveTo(x + shape.r, y);
| ctx.arc(x, y, shape.r, 0, PI2, false);
| ctx.moveTo(x + shape.r0, y);
| ctx.arc(x, y, shape.r0, 0, PI2, true);
| }
| });
|
| module.exports = _default;
|
|