medsurf-draw
Version:
Draw annotations on jpg/zoomify images, based on PIXI.js
84 lines • 2.94 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
import { BaseGraphics, BaseGraphicsModel } from "../../bases/elements/BaseGraphics";
var CircleModel = (function (_super) {
__extends(CircleModel, _super);
function CircleModel() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.options = { hasLine: true, lineColor: 0xFFFFFF, lineAlpha: 1, hasFill: false };
_this.lineWidth = 1;
return _this;
}
return CircleModel;
}(BaseGraphicsModel));
export { CircleModel };
var Circle = (function (_super) {
__extends(Circle, _super);
function Circle(model) {
return _super.call(this, model) || this;
}
Circle.prototype.init = function () {
this.sortChildren();
this.emit("debounceDraw");
};
Circle.prototype.draw = function () {
if (!this._geometry) {
return;
}
this.clear();
if (this.options.hasLine) {
this.lineStyle(this.lineWidth || 1, this.options.lineColor, this.options.lineAlpha, 1);
}
if (this.options.hasFill) {
this.beginFill(this.options.fillColor, this.options.fillAlpha);
}
this.drawCircle(this.circle.x, this.circle.y, this.circle.radius);
this.endFill();
};
Object.defineProperty(Circle.prototype, "circle", {
get: function () {
return this.data.circle;
},
set: function (value) {
this.data.circle = value;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Circle.prototype, "options", {
get: function () {
return this.data.options;
},
set: function (value) {
this.data.options = value;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Circle.prototype, "lineWidth", {
get: function () {
return this.data.lineWidth;
},
set: function (value) {
this.data.lineWidth = value;
},
enumerable: false,
configurable: true
});
return Circle;
}(BaseGraphics));
export { Circle };
//# sourceMappingURL=Circle.js.map