@aurigma/design-atoms
Version:
Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.
15 lines • 774 B
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() {
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: true, preventEvent: preventEvent !== null && preventEvent !== void 0 ? preventEvent : false }, false, withoutUpdate !== null && withoutUpdate !== void 0 ? withoutUpdate : false);
}
}
//# sourceMappingURL=SetZoomCommand.js.map