UNPKG

884 BJavaScriptView Raw
1import { __extends } from "tslib";
2import Path from '../Path.js';
3var RingShape = (function () {
4 function RingShape() {
5 this.cx = 0;
6 this.cy = 0;
7 this.r = 0;
8 this.r0 = 0;
9 }
10 return RingShape;
11}());
12export { RingShape };
13var Ring = (function (_super) {
14 __extends(Ring, _super);
15 function Ring(opts) {
16 return _super.call(this, opts) || this;
17 }
18 Ring.prototype.getDefaultShape = function () {
19 return new RingShape();
20 };
21 Ring.prototype.buildPath = function (ctx, shape) {
22 var x = shape.cx;
23 var y = shape.cy;
24 var PI2 = Math.PI * 2;
25 ctx.moveTo(x + shape.r, y);
26 ctx.arc(x, y, shape.r, 0, PI2, false);
27 ctx.moveTo(x + shape.r0, y);
28 ctx.arc(x, y, shape.r0, 0, PI2, true);
29 };
30 return Ring;
31}(Path));
32Ring.prototype.type = 'ring';
33export default Ring;