import { MiTools , MiToolsSyncData , Tools } from '@components/canvas/Tools' ; import { Canvas } from '@components/canvas/Canvas' ; import { Point } from '@components/canvas/Point' ; export class Drag extends Tools implements MiTools { name = 'drag' ; start = new Point ( 0 , 0 ) ; param canvas constructor ( canvas ) { super ( canvas ) ; Tools . instances [ this . name ] = this ; } draw < A extends MiToolsSyncData [ ] > ( ... args ) { } param event protected drawBegin ( event ) { this . start = this . createPoint ( event . clientX , event . clientY ) ; this . drawUpdate ( event ) ; } param event protected drawUpdate ( event ) { const point = this . createPoint ( event . clientX , event . clientY ) , x = point . x - this . start . x , y = point . y - this . start . y ; Tools . getStage ( ) . updateTransformOrigin ( x , y , true ) ; this . start = point ; } param event protected drawEnd ( event ) { } }