Skip to content

Commit a84e752

Browse files
committed
test
1 parent 75d8ad1 commit a84e752

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

07-Ping-Pong-Game/script.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,11 @@ function actionMove(e) {
398398
let rightPt = {pageX:canvas.offsetLeft + canvas.width / 2,pageY:0};
399399
ballColor = 'red';
400400
for (let i = 1; i < e.touches.length; i++) {
401-
if (e.touches[i].pageX < leftPt.pageX) {
401+
if (e.touches[i].pageX < leftPt.pageX- canvas.offsetLeft) {
402402
leftPt = e.touches[i];
403403

404404
}
405-
if (e.touches[i].pageX > rightPt.pageX) {
405+
if (e.touches[i].pageX > rightPt.pageX- canvas.offsetLeft) {
406406
rightPt = e.touches[i];
407407

408408
}

0 commit comments

Comments
 (0)