File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -218,9 +218,17 @@ export class Fireworks {
218218 window . addEventListener ( 'resize' , ( ) => this . windowResize ( ) )
219219 }
220220
221- this . _canvas . addEventListener ( 'mousedown' , e => this . mouseDown ( e ) )
222- this . _canvas . addEventListener ( 'mouseup' , e => this . mouseUp ( e ) )
223- this . _canvas . addEventListener ( 'mousemove' , e => this . mouseMove ( e ) )
221+ this . _canvas . addEventListener ( 'mousedown' , ( event ) => {
222+ this . mouseDown ( event )
223+ } )
224+
225+ this . _canvas . addEventListener ( 'mouseup' , ( event ) => {
226+ this . mouseUp ( event )
227+ } )
228+
229+ this . _canvas . addEventListener ( 'mousemove' , ( event ) => {
230+ this . mouseMove ( event )
231+ } )
224232 }
225233
226234 get isRunning ( ) : boolean {
@@ -248,9 +256,9 @@ export class Fireworks {
248256
249257 unmount ( ) : void {
250258 window . removeEventListener ( 'resize' , this . windowResize )
251- this . _canvas . addEventListener ( 'mousedown' , this . mouseDown )
252- this . _canvas . addEventListener ( 'mouseup' , this . mouseUp )
253- this . _canvas . addEventListener ( 'mousemove' , this . mouseMove )
259+ this . _canvas . removeEventListener ( 'mousedown' , this . mouseDown )
260+ this . _canvas . removeEventListener ( 'mouseup' , this . mouseUp )
261+ this . _canvas . removeEventListener ( 'mousemove' , this . mouseMove )
254262 }
255263
256264 pause ( ) : void {
You can’t perform that action at this time.
0 commit comments