UNPKG

755 BJavaScriptView Raw
1import { __extends } from "tslib";
2import Path from '../Path.js';
3var CircleShape = (function () {
4 function CircleShape() {
5 this.cx = 0;
6 this.cy = 0;
7 this.r = 0;
8 }
9 return CircleShape;
10}());
11export { CircleShape };
12var Circle = (function (_super) {
13 __extends(Circle, _super);
14 function Circle(opts) {
15 return _super.call(this, opts) || this;
16 }
17 Circle.prototype.getDefaultShape = function () {
18 return new CircleShape();
19 };
20 Circle.prototype.buildPath = function (ctx, shape) {
21 ctx.moveTo(shape.cx + shape.r, shape.cy);
22 ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2);
23 };
24 return Circle;
25}(Path));
26;
27Circle.prototype.type = 'circle';
28export default Circle;