UNPKG

medsurf-draw

Version:

Draw annotations on jpg/zoomify images, based on PIXI.js

84 lines 2.98 kB
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 EllipseModel = (function (_super) { __extends(EllipseModel, _super); function EllipseModel() { 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 EllipseModel; }(BaseGraphicsModel)); export { EllipseModel }; var Ellipse = (function (_super) { __extends(Ellipse, _super); function Ellipse(model) { return _super.call(this, model) || this; } Ellipse.prototype.init = function () { this.sortChildren(); this.emit("debounceDraw"); }; Ellipse.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.drawEllipse(this.ellipse.x, this.ellipse.y, this.ellipse.width, this.ellipse.height); this.endFill(); }; Object.defineProperty(Ellipse.prototype, "ellipse", { get: function () { return this.data.ellipse; }, set: function (value) { this.data.ellipse = value; }, enumerable: false, configurable: true }); Object.defineProperty(Ellipse.prototype, "options", { get: function () { return this.data.options; }, set: function (value) { this.data.options = value; }, enumerable: false, configurable: true }); Object.defineProperty(Ellipse.prototype, "lineWidth", { get: function () { return this.data.lineWidth; }, set: function (value) { this.data.lineWidth = value; }, enumerable: false, configurable: true }); return Ellipse; }(BaseGraphics)); export { Ellipse }; //# sourceMappingURL=Ellipse.js.map