cione-comp-lib
Version:
`$ yarn add cione-comp-lib` 或者 `$ npm i cione-comp-lib -S`
34 lines (33 loc) • 853 B
JavaScript
import { __extends } from "../../../../tslib/tslib.es6.mjs";
import Path from "../Path.mjs";
var RingShape = function() {
function RingShape2() {
this.cx = 0;
this.cy = 0;
this.r = 0;
this.r0 = 0;
}
return RingShape2;
}();
var Ring = function(_super) {
__extends(Ring2, _super);
function Ring2(opts) {
return _super.call(this, opts) || this;
}
Ring2.prototype.getDefaultShape = function() {
return new RingShape();
};
Ring2.prototype.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);
};
return Ring2;
}(Path);
Ring.prototype.type = "ring";
var Ring$1 = Ring;
export { RingShape, Ring$1 as default };