File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
frontend/src/routes/[lobby]/game_answer Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 5353 function draw (event ) {
5454 event .preventDefault ();
5555 if (! drawing) return ;
56- ctx .lineTo (event .offsetX , event .offsetY );
56+ const { x , y } = getEventCoordinates (event );
57+ ctx .lineTo (x, y);
5758 ctx .stroke ();
5859 }
5960
60- function stopDrawing () {
61+ function stopDrawing (event ) {
6162 event .preventDefault ();
6263 drawing = false ;
6364 ctx .closePath ();
105106 ctx .lineCap = ' round' ;
106107
107108 window .addEventListener (' resize' , resizeCanvas);
109+ document .body .addEventListener (' touchstart' , (e ) => e .preventDefault (), { passive: false });
110+ document .body .addEventListener (' touchmove' , (e ) => e .preventDefault (), { passive: false });
108111
109112 nickname = localStorage .getItem (' nickname' ) || ' ' ;
110113 selectAvatar = localStorage .getItem (' selectAvatar' ) || ' ' ;
You can’t perform that action at this time.
0 commit comments