UNPKG

@wcardinal/wcardinal-geditor

Version:

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

48 lines 1.73 kB
import { __extends } from "tslib"; import { DCommandBase } from "@wcardinal/wcardinal-ui"; import { EShapeTable } from "./e-shape-table"; var ECommandShapeTableRowHeight = /** @class */ (function (_super) { __extends(ECommandShapeTableRowHeight, _super); function ECommandShapeTableRowHeight(value, selection) { var _this = _super.call(this) || this; var shapes = selection.get(); var values = []; for (var i = 0, imax = shapes.length; i < imax; ++i) { var shape = shapes[i]; if (shape instanceof EShapeTable) { values.push(shape.row.height); shape.row.height = value; } else { values.push(35); } } _this._values = values; _this._selection = selection; return _this; } ECommandShapeTableRowHeight.prototype.execute = function () { return true; }; ECommandShapeTableRowHeight.prototype.redo = function () { var selection = this._selection; var shapes = selection.get(); var values = []; for (var i = 0, imax = shapes.length; i < imax; ++i) { var shape = shapes[i]; if (shape instanceof EShapeTable) { var value = values[i]; values[i] = shape.row.height; shape.row.height = value; } } selection.update("PROPERTY"); return true; }; ECommandShapeTableRowHeight.prototype.undo = function () { return this.redo(); }; return ECommandShapeTableRowHeight; }(DCommandBase)); export { ECommandShapeTableRowHeight }; //# sourceMappingURL=e-command-shape-table-row-height.js.map