@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 • 561 B
JavaScript
import { BaseCommand } from "../BaseCommand";
export class ZoomToSelectionCommand extends BaseCommand {
constructor(_canvas) {
super(null);
this._canvas = _canvas;
}
async execute() {
var _a, _b;
var rect = (_b = (_a = this._canvas) === null || _a === void 0 ? void 0 : _a.selectionVisibleRectangle) === null || _b === void 0 ? void 0 : _b.bounds;
if (rect == null)
return;
this._canvas.viewer.zoomToRectangle(rect);
}
}
//# sourceMappingURL=ZoomToSelectionCommand.js.map