浏览代码

多点触控

huangxiaojing 3 年之前
父节点
当前提交
209c36049d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      screenAndroid/WXdraw.js

+ 1 - 1
screenAndroid/WXdraw.js

@@ -179,6 +179,7 @@ var draw_graph = function (graphType, obj) {
       "right": "-4rem"
     })
     var touchfor = e.originalEvent.changedTouches[0]; //for 的手指数组
+    ongoingTouches.push(touchfor);
     var acrossWidthX = touchfor.pageY * (videoHeight / voheight);
     var acrossHeightY = videoWidth - touchfor.pageX * (videoWidth / vowidth);
     var verticalWidthX = touchfor.pageX * (videoWidth / vowidth);
@@ -189,7 +190,6 @@ var draw_graph = function (graphType, obj) {
     { "data": { "action": 0, "count": ongoingTouches.length, "id": touchfor.identifier, "x": verticalWidthX.toFixed(2), "y": verticalHeightY.toFixed(2) }, "type": "event" };
     console.log(ping);
     wsss.send(JSON.stringify(ping));
-    ongoingTouches.push(touchfor);
     canDraw = true;
   };