@wcardinal/wcardinal-geditor
Version:
WebGL-based graphic editor, tester and viewer for supervisory systems
51 lines • 1.73 kB
JavaScript
import { __extends } from "tslib";
import { DCommandBase } from "@wcardinal/wcardinal-ui";
var ECommandDocumentHeight = /** @class */ (function (_super) {
__extends(ECommandDocumentHeight, _super);
function ECommandDocumentHeight(diagram, canvas, height) {
var _this = _super.call(this) || this;
_this._diagram = diagram;
_this._canvas = canvas;
_this._height = height;
return _this;
}
Object.defineProperty(ECommandDocumentHeight.prototype, "diagram", {
get: function () {
return this._diagram;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ECommandDocumentHeight.prototype, "canvas", {
get: function () {
return this._canvas;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ECommandDocumentHeight.prototype, "height", {
get: function () {
return this._height;
},
enumerable: false,
configurable: true
});
ECommandDocumentHeight.prototype.execute = function () {
return this.redo();
};
ECommandDocumentHeight.prototype.redo = function () {
var canvas = this._canvas;
var height = this._height;
this._height = canvas.height;
canvas.y = canvas.y + (canvas.height - height) * 0.5;
canvas.height = height;
this._diagram.emit("change", this._diagram);
return true;
};
ECommandDocumentHeight.prototype.undo = function () {
return this.redo();
};
return ECommandDocumentHeight;
}(DCommandBase));
export { ECommandDocumentHeight };
//# sourceMappingURL=e-command-document-height.js.map