@aurigma/design-atoms
Version:
Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.
26 lines • 1.04 kB
JavaScript
import { BaseProductCommand } from "./BaseProductCommand";
import { WorkspaceRotation } from "../../Services/WorkspaceRotation";
import { NotImplementedException } from "@aurigma/design-atoms-model/Exception";
export class RotateProductCommand extends BaseProductCommand {
constructor(_productHandler, historyArgs, product, args) {
super(product, historyArgs, args);
this._productHandler = _productHandler;
this._rotationAlgorithm = new WorkspaceRotation();
}
async _executeCommandBody() {
return this.rotateProduct(this._args.rotationType);
}
redo() {
throw new NotImplementedException();
}
undo() {
throw new NotImplementedException();
}
rotateProduct(type) {
if (this._productHandler != null && this._product != null) {
this._rotationAlgorithm.rotate(this._productHandler.currentSurface, type);
}
return this._productHandler.contentAngle;
}
}
//# sourceMappingURL=RotateProductCommand.js.map