import Tool from './tool';

export default class PanTool extends Tool {


  constructor() {
    super('pan', 'move');
  }

  /**
   * Always in progress
   * Prevent control drag while pan.
   */
  override inProgress(evt : MouseEvent) {
    return true;
  }

  override onDragStart(evt : MouseEvent) {
    this.onDragMove(evt);
  }

  override onDragMove(evt : MouseEvent) {
    if(this.editor) {
      this.editor.pan(evt._dx, evt._dy);
    }
  }

}
