medsurf-draw
Version:
Draw annotations on jpg/zoomify images, based on PIXI.js
82 lines • 3.07 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 { BaseElementInteraction } from "../bases/interactions/BaseElementInteraction";
export var SELECT_HITTEST_EXTENSION = 1000;
var SelectInteraction = (function (_super) {
__extends(SelectInteraction, _super);
function SelectInteraction(element) {
return _super.call(this, element) || this;
}
SelectInteraction.prototype.reset = function () {
this._isSelected = false;
};
SelectInteraction.prototype.onPointerDown = function (event) {
event.stopPropagation();
};
SelectInteraction.prototype.onHover = function (event) {
event.stopPropagation();
this.element.cursor = "select";
this.emit("onHover", event);
};
SelectInteraction.prototype.onOut = function (event) {
event.stopPropagation();
this.element.cursor = "default";
this.emit("onOut", event);
};
SelectInteraction.prototype.onSelect = function (event) {
event.stopPropagation();
this.element.cursor = "select";
this.emit("onSelectStart", event);
if (this._isSelected) {
return;
}
this._isSelected = true;
this.emit("onSelect", event);
};
SelectInteraction.prototype.onSelftest = function (event) {
event.stopPropagation();
this.element.cursor = "select";
this.emit("onSelftestStart", event);
if (this._isSelected) {
return;
}
this._isSelected = true;
this.emit("onSelftest", event);
};
SelectInteraction.prototype.onInteractive = function (event) {
event.stopPropagation();
this.element.cursor = "select";
this.emit("onInteractiveStart", event);
if (this._isSelected) {
return;
}
this._isSelected = true;
this.emit("onInteractive", event);
};
SelectInteraction.prototype.onRelease = function (event) {
event.stopPropagation();
this.element.cursor = "default";
this.emit("onReleaseStart", event);
if (!this._isSelected) {
return;
}
this._isSelected = false;
this.emit("onRelease", event);
};
return SelectInteraction;
}(BaseElementInteraction));
export { SelectInteraction };
//# sourceMappingURL=SelectInteraction.js.map