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
27
28
29
30
31
32
| var Path = require("../Path");
|
| /**
| * 圆形
| * @module zrender/shape/Circle
| */
| var _default = Path.extend({
| type: 'circle',
| shape: {
| cx: 0,
| cy: 0,
| r: 0
| },
| buildPath: function (ctx, shape, inBundle) {
| // Better stroking in ShapeBundle
| // Always do it may have performence issue ( fill may be 2x more cost)
| if (inBundle) {
| ctx.moveTo(shape.cx + shape.r, shape.cy);
| } // else {
| // if (ctx.allocate && !ctx.data.length) {
| // ctx.allocate(ctx.CMD_MEM_SIZE.A);
| // }
| // }
| // Better stroking in ShapeBundle
| // ctx.moveTo(shape.cx + shape.r, shape.cy);
|
|
| ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2, true);
| }
| });
|
| module.exports = _default;
|
|