UNPKG

@aurigma/design-atoms

Version:

Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.

19 lines 834 B
import { InputState } from "./../../../Input/InputManager/IInputManager"; import { PointF } from "@aurigma/design-atoms-model/Math"; import { ViewerCommand } from "@aurigma/design-atoms-interfaces"; export class PanHandler { constructor(_commandManager) { this._commandManager = _commandManager; } async process(params) { const startPoint = params.state === InputState.Started ? params.startPage.clone() : this._lastPoint; const args = { delta: new PointF(startPoint.x - params.page.x, startPoint.y - params.page.y) }; await this._commandManager.execute(ViewerCommand.moveViewPort, args); this._lastPoint = params.state === InputState.Finished ? null : params.page.clone(); } } //# sourceMappingURL=PanHandler.js.map