Skip to content

Instantly share code, notes, and snippets.

@AnteaterKit
Created October 2, 2022 18:14
Show Gist options
  • Save AnteaterKit/b9cda5329c0574348d6fc23a0fe1fe4f to your computer and use it in GitHub Desktop.
Save AnteaterKit/b9cda5329c0574348d6fc23a0fe1fe4f to your computer and use it in GitHub Desktop.
WhiteBoardMovedState
export class WhiteBoardMovedState extends WhiteBoardState {
public handleTouchstart(e: any): void {
this.whiteBoard.touchStartStage(e.evt);
}
public handleTouchend(e: any): void {
const position = e.currentTarget.position();
this.whiteBoard.offsetX = -position.x;
this.whiteBoard.offsetY = -position.y;
this.whiteBoard.backLayerRender.updateGrid(this.whiteBoard.width, this.whiteBoard.height, position.x, position.y, this.whiteBoard.scaleOffset);
}
public handleTouchmove(e: any): void {
this.whiteBoard.touchMoveStage(e.evt);
}
public handleDragend(e: any): void {
const position = e.currentTarget.position();
this.whiteBoard.offsetX = -position.x;
this.whiteBoard.offsetY = -position.y;
this.whiteBoard.backLayerRender.updateGrid(this.whiteBoard.width, this.whiteBoard.height, position.x, position.y, this.whiteBoard.scaleOffset);
}
public handleClick(e): void {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment