UNPKG

@wcardinal/wcardinal-geditor

Version:

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

34 lines 1.73 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 ECommandShapePropertyPositionLeft = /** @class */ (function (_super) { __extends(ECommandShapePropertyPositionLeft, _super); function ECommandShapePropertyPositionLeft() { return _super !== null && _super.apply(this, arguments) || this; } ECommandShapePropertyPositionLeft.prototype.toCapability = function (shape) { if (EShapeCapabilities.contains(shape, EShapeCapability.POSITION)) { return EShapeCapability.POSITION; } return EShapeCapability.NONE; }; ECommandShapePropertyPositionLeft.prototype.getProperty = function (shape, capability) { return shape.transform.position.x; }; ECommandShapePropertyPositionLeft.prototype.setProperty = function (shape, capability, property) { shape.transform.position.x = property; }; ECommandShapePropertyPositionLeft.prototype.initProperty = function (shape, capability, property) { var _a; var rectangle = ((_a = ECommandShapePropertyPositionLeft.WORK) !== null && _a !== void 0 ? _a : (ECommandShapePropertyPositionLeft.WORK = new Rectangle())); shape.getBoundsLocal(false, rectangle); shape.transform.position.x += property - rectangle.x; }; ECommandShapePropertyPositionLeft.prototype.isMergeable = function () { return true; }; return ECommandShapePropertyPositionLeft; }(ECommandShapeProperty)); export { ECommandShapePropertyPositionLeft }; //# sourceMappingURL=e-command-shape-property-position-left.js.map