@wcardinal/wcardinal-geditor
Version:
WebGL-based graphic editor, tester and viewer for supervisory systems
49 lines • 1.98 kB
JavaScript
import { __extends } from "tslib";
import { EShapeGroupShadowed } from "@wcardinal/wcardinal-ui";
import { EShapeTableBodyRuntime } from "./e-shape-table-body-runtime";
import { EShapeTableIds } from "./e-shape-table-ids";
var EShapeTableBody = /** @class */ (function (_super) {
__extends(EShapeTableBody, _super);
function EShapeTableBody(mode, type) {
if (type === void 0) { type = EShapeTableIds.BODY_ID; }
return _super.call(this, mode, type) || this;
}
EShapeTableBody.prototype.containsAbs = function (x, y, ax, ay) {
if (this.containsAbsBBox(x, y, ax, ay)) {
var children = this.children;
if (0 < children.length) {
var first = children[0];
var rowIndex = ((ay + y) / first.size.y) | 0;
if (rowIndex < children.length) {
var cells = first.children;
for (var i = 0, imax = cells.length; i < imax; ++i) {
var cell = cells[i];
var cx = cell.transform.position.x;
var csx = 0.5 * cell.size.x;
if (x < cx + csx) {
var runtime = this.runtime;
if (runtime instanceof EShapeTableBodyRuntime) {
runtime.onCellTouched(this, rowIndex, i);
}
return true;
}
}
return true;
}
else {
return false;
}
}
}
return false;
};
EShapeTableBody.prototype.containsText = function (x, y) {
return null;
};
EShapeTableBody.prototype.containsChildren = function (x, y) {
return null;
};
return EShapeTableBody;
}(EShapeGroupShadowed));
export { EShapeTableBody };
//# sourceMappingURL=e-shape-table-body.js.map