medsurf-draw
Version:
Draw annotations on jpg/zoomify images, based on PIXI.js
63 lines • 2.3 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 { BaseInteraction } from "../bases/interactions/BaseInteraction";
var CloneInteraction = (function (_super) {
__extends(CloneInteraction, _super);
function CloneInteraction() {
var _this = _super.call(this) || this;
_this._mouseDown = 0;
_this._moveLock = false;
return _this;
}
CloneInteraction.prototype.reset = function () {
this._mouseDown = 0;
this._moveLock = false;
};
CloneInteraction.prototype.startClone = function (event) {
event.stopPropagation();
this._mouseDown++;
this.emit("startClone", event);
};
CloneInteraction.prototype.resetClone = function (event) {
event.stopPropagation();
this.reset();
this.emit("resetClone", event);
};
CloneInteraction.prototype.onClone = function (event) {
if (this._mouseDown) {
this._moveLock = true;
return;
}
this.emit("onClone", event);
};
CloneInteraction.prototype.endClone = function (event) {
event.stopPropagation();
this._mouseDown--;
if (this._moveLock) {
this.resetClone(event);
return;
}
this.emit("endClone", event);
};
CloneInteraction.prototype.abortClone = function (event) {
event.stopPropagation();
this.reset();
this.emit("abortClone", event);
};
return CloneInteraction;
}(BaseInteraction));
export { CloneInteraction };
//# sourceMappingURL=CloneInteraction.js.map