medsurf-draw
Version:
Draw annotations on jpg/zoomify images, based on PIXI.js
40 lines • 1.61 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 { BaseSprite } from "../../bases/elements/BaseSprite";
import { debounce } from 'debounce';
var Sprite = (function (_super) {
__extends(Sprite, _super);
function Sprite(model) {
var _this = _super.call(this, model) || this;
_this._debounceDrawMethod = debounce(_this.draw.bind(_this), 20).bind(_this);
_this.on("added", function () {
_this.on("debounceDraw", _this._debounceDrawMethod);
});
_this.on("removed", function () {
_this.off("debounceDraw", _this._debounceDrawMethod);
});
return _this;
}
Sprite.prototype.init = function () {
this.sortChildren();
this.emit("debounceDraw");
};
Sprite.prototype.draw = function () {
};
return Sprite;
}(BaseSprite));
export { Sprite };
//# sourceMappingURL=Sprite.js.map