UNPKG

@wcardinal/wcardinal-geditor

Version:

WebGL-based graphic editor, tester and viewer for supervisory systems

39 lines 1.62 kB
import { __extends } from "tslib"; import { DListItem, UtilPointerEvent } from "@wcardinal/wcardinal-ui"; var EEditorLayerItem = /** @class */ (function (_super) { __extends(EEditorLayerItem, _super); function EEditorLayerItem(iconsEye, iconsEyeSlash, work, data, options) { var _this = _super.call(this, data, options) || this; _this._iconsEye = iconsEye; _this._iconsEyeSlash = iconsEyeSlash; _this._iconsWork = work; return _this; } EEditorLayerItem.prototype.onSelect = function (e, value) { if (e != null) { var local = this._iconsWork; if ("data" in e) { this.toLocal(e.data.global, undefined, local); if (local.x <= this._iconsEye.width + this.padding.getLeft()) { this.emit("eyeclick", e, value, this); return; } } } _super.prototype.onSelect.call(this, e, value); }; EEditorLayerItem.prototype.onDblClick = function (e, interactionManager) { var global = UtilPointerEvent.toGlobal(e, interactionManager, this._iconsWork); var local = this.toLocal(global, undefined, global); if (this._iconsEye.width + this.padding.getLeft() < local.x) { return _super.prototype.onDblClick.call(this, e, interactionManager); } else { this.emit("eyedblclick", e, interactionManager, this); return false; } }; return EEditorLayerItem; }(DListItem)); export { EEditorLayerItem }; //# sourceMappingURL=e-editor-layer-item.js.map