@aurigma/design-atoms
Version:
Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.
28 lines • 1.4 kB
JavaScript
import { BaseItemsCommand } from "../BaseItemsCommand";
import { NotImplementedException, ArgumentException } from "@aurigma/design-atoms-model/Exception";
import { PlaceholderItemHandler } from "../../../ItemHandlers";
export class TransformItemsCommand extends BaseItemsCommand {
constructor(productHandler, historyArgs, args) {
super(productHandler, historyArgs, args);
}
async _executeCommandBody() {
let { matrix, finished, newAngle } = this._args;
const items = this._getTargetItems(this._args.items, this._args.query, this._args.queryOptions);
if (items == null || matrix == null)
throw new ArgumentException("TransformItemsCommand: items and matrix cannot be null!");
finished = finished !== null && finished !== void 0 ? finished : true;
items.map(this._productHandler.getHandler).forEach((itemHandler) => {
itemHandler.transformByMatrix(matrix, finished, newAngle);
if (itemHandler instanceof PlaceholderItemHandler)
itemHandler.updateContentAndFrames(i => i.transformByMatrix(matrix, finished, newAngle));
});
await this._productHandler.waitUpdate();
}
redo() {
throw new NotImplementedException();
}
undo() {
throw new NotImplementedException();
}
}
//# sourceMappingURL=TransformItemsCommand.js.map