UNPKG

@wcardinal/wcardinal-geditor

Version:

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

29 lines 1.07 kB
import { Rectangle } from "pixi.js"; var UtilShapeAreaSelect = /** @class */ (function () { function UtilShapeAreaSelect() { } UtilShapeAreaSelect.isShapeIn = function (shape, rect) { var _a; var bound = shape.getBounds(false, ((_a = this._work) !== null && _a !== void 0 ? _a : (this._work = new Rectangle()))); var x = bound.x; var y = bound.y; var w = bound.width; var h = bound.height; return (rect.contains(x, y) && rect.contains(x + w, y) && rect.contains(x, y + h) && rect.contains(x + w, y + h)); }; UtilShapeAreaSelect.findShapes = function (container, rect, result) { var children = container.children; for (var i = 0, imax = children.length; i < imax; ++i) { var child = children[i]; if (this.isShapeIn(child, rect)) { result.push(child); } } }; return UtilShapeAreaSelect; }()); export { UtilShapeAreaSelect }; //# sourceMappingURL=util-shape-area-select.js.map