@aurigma/design-atoms
Version:
Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.
23 lines • 1.09 kB
JavaScript
import { BaseCommand } from "../BaseCommand";
import { ArgumentException } from "@aurigma/design-atoms-model/Exception";
export class SetZoomCommand extends BaseCommand {
constructor(args, _canvas) {
super(args);
this._canvas = _canvas;
}
async execute() {
var _a;
const { withoutUpdate, zoom, preventEvent } = this._args;
if (zoom == null)
throw new ArgumentException(`SetZoomCommand: zoom cannot be null!`);
this._canvas.viewer.setZoom(this._args.zoom, {
skipZoomToCenter: (_a = this._args.skipZoomToCenter) !== null && _a !== void 0 ? _a : true,
preventEvent: preventEvent !== null && preventEvent !== void 0 ? preventEvent : false,
centerPageX: this._args.centerPageX,
centerPageY: this._args.centerPageY,
workspaceX: this._args.workspaceX,
workspaceY: this._args.workspaceY,
}, true, withoutUpdate !== null && withoutUpdate !== void 0 ? withoutUpdate : false);
}
}
//# sourceMappingURL=SetZoomCommand.js.map