File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -318,7 +318,7 @@ function keyRight() {// pressed right arrow key
318
318
var touchXstart = null ;
319
319
var previousPosition = canvas . width / 2 - paddle . w / 2 ;
320
320
function actionStart ( e ) {
321
- e . preventDefault ( ) ;
321
+ // e.preventDefault();
322
322
//判断是鼠标左键点击还是触摸
323
323
if ( e . touches && touchXstart == null ) { //如果是触摸 touchXstart等于第一个touch点的x坐标
324
324
touchXstart = e . touches [ 0 ] . pageX ;
@@ -327,7 +327,7 @@ function actionStart(e){
327
327
}
328
328
}
329
329
function actionEnd ( e ) {
330
- e . preventDefault ( ) ;
330
+ // e.preventDefault();
331
331
touchXstart = null ;
332
332
previousPosition = paddle . x ;
333
333
}
@@ -337,7 +337,7 @@ function actionMove(e){
337
337
//判断是鼠标左键点击还是触摸
338
338
if ( touchXstart != null ) {
339
339
if ( e . touches ) { //如果是触摸 dist等于第一个touch点的x坐标x相对touchXstart的移动距离
340
- dist = e . touches [ 0 ] . pageX - touchXstart ;
340
+ dist = ( e . touches [ 0 ] . pageX - touchXstart ) * 2 ;
341
341
} else { //如果是鼠标 dist等于鼠标的x坐标x相对touchXstart的移动距离
342
342
dist = e . pageX - touchXstart ;
343
343
}
You can’t perform that action at this time.
0 commit comments