UNPKG

@wcardinal/wcardinal-geditor

Version:

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

34 lines 1.72 kB
import { __extends } from "tslib"; import { EShapeCapabilities, EShapeCapability } from "@wcardinal/wcardinal-ui"; import { Rectangle } from "pixi.js"; import { ECommandShapeProperty } from "./e-command-shape-property"; var ECommandShapePropertyPositionTop = /** @class */ (function (_super) { __extends(ECommandShapePropertyPositionTop, _super); function ECommandShapePropertyPositionTop() { return _super !== null && _super.apply(this, arguments) || this; } ECommandShapePropertyPositionTop.prototype.toCapability = function (shape) { if (EShapeCapabilities.contains(shape, EShapeCapability.POSITION)) { return EShapeCapability.POSITION; } return EShapeCapability.NONE; }; ECommandShapePropertyPositionTop.prototype.getProperty = function (shape, capability) { return shape.transform.position.y; }; ECommandShapePropertyPositionTop.prototype.setProperty = function (shape, capability, property) { shape.transform.position.y = property; }; ECommandShapePropertyPositionTop.prototype.initProperty = function (shape, capability, property) { var _a; var rectangle = ((_a = ECommandShapePropertyPositionTop.WORK) !== null && _a !== void 0 ? _a : (ECommandShapePropertyPositionTop.WORK = new Rectangle())); shape.getBoundsLocal(false, rectangle); shape.transform.position.y += property - rectangle.y; }; ECommandShapePropertyPositionTop.prototype.isMergeable = function () { return true; }; return ECommandShapePropertyPositionTop; }(ECommandShapeProperty)); export { ECommandShapePropertyPositionTop }; //# sourceMappingURL=e-command-shape-property-position-top.js.map