UNPKG

medsurf-draw

Version:

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

82 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, BaseGraphicsImageModel } from "../../bases/elements/BaseGraphics"; var LineCornerModel = (function (_super) { __extends(LineCornerModel, _super); function LineCornerModel() { return _super !== null && _super.apply(this, arguments) || this; } return LineCornerModel; }(BaseGraphicsImageModel)); export { LineCornerModel }; var LineCorner = (function (_super) { __extends(LineCorner, _super); function LineCorner(model) { return _super.call(this, model) || this; } LineCorner.prototype.init = function () { this.sortChildren(); this.emit("debounceDraw"); }; LineCorner.prototype.draw = function () { if (!this._geometry) { return; } this.cacheAsBitmap = false; this.clear(); if (this.points) { this.lineStyle(this.lineWidth / 2, this.options.lineColor, this.options.lineAlpha); this.beginFill(this.options.lineColor, this.options.lineAlpha); this.drawCircle(this.points.start.x, this.points.start.y, this.lineWidth / 4); this.drawCircle(this.points.end.x, this.points.end.y, this.lineWidth / 4); this.endFill(); } this.cacheAsBitmap = true; }; Object.defineProperty(LineCorner.prototype, "points", { get: function () { return this.data.points; }, set: function (value) { this.data.points = value; }, enumerable: false, configurable: true }); Object.defineProperty(LineCorner.prototype, "options", { get: function () { return this.data.options; }, set: function (value) { this.data.options = value; }, enumerable: false, configurable: true }); Object.defineProperty(LineCorner.prototype, "lineWidth", { get: function () { return this.data.lineWidth; }, set: function (value) { this.data.lineWidth = value; }, enumerable: false, configurable: true }); return LineCorner; }(BaseGraphics)); export { LineCorner }; //# sourceMappingURL=LineCorner.js.map