Created
October 2, 2022 18:14
-
-
Save AnteaterKit/b9cda5329c0574348d6fc23a0fe1fe4f to your computer and use it in GitHub Desktop.
WhiteBoardMovedState
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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