瀏覽代碼

多点触控

huangxiaojing 3 年之前
父節點
當前提交
c094d69061
共有 1 個文件被更改,包括 6 次插入6 次删除
  1. 6 6
      screenAndroid/WXdraw.js

+ 6 - 6
screenAndroid/WXdraw.js

@@ -192,8 +192,8 @@ var draw_graph = function (graphType, obj) {
         ongoingTouches.push(touchfor[i]);
       }
       var ping = resolving == 0 ?
-        { "data": { "action": 0, "count": ongoingTouches.length, "id": touchfor[i].identifier, "x": acrossWidthX.toFixed(2), "y": acrossHeightY.toFixed(2) }, "type": "event" } :
-        { "data": { "action": 0, "count": ongoingTouches.length, "id": touchfor[i].identifier, "x": verticalWidthX.toFixed(2), "y": verticalHeightY.toFixed(2) }, "type": "event" };
+        { "data": { "action": 0, "count": ongoingTouches.length, "pointerId": touchfor[i].identifier, "x": acrossWidthX.toFixed(2), "y": acrossHeightY.toFixed(2) }, "type": "event" } :
+        { "data": { "action": 0, "count": ongoingTouches.length, "pointerId": touchfor[i].identifier, "x": verticalWidthX.toFixed(2), "y": verticalHeightY.toFixed(2) }, "type": "event" };
       console.log(ping);
       wsss.send(JSON.stringify(ping));
     }
@@ -210,8 +210,8 @@ var draw_graph = function (graphType, obj) {
       var verticalWidthX = touchfor[i].pageX * (videoWidth / vowidth);
       var verticalHeightY = touchfor[i].pageY * (videoHeight / voheight);
       var ping = resolving == 0 ?
-        { "data": { "action": 1, "count": ongoingTouches.length, "id": touchfor[i].identifier, "x": acrossWidthX.toFixed(2), "y": acrossHeightY.toFixed(2) }, "type": "event" } :
-        { "data": { "action": 1, "count": ongoingTouches.length, "id": touchfor[i].identifier, "x": verticalWidthX.toFixed(2), "y": verticalHeightY.toFixed(2) }, "type": "event" };
+        { "data": { "action": 1, "count": ongoingTouches.length, "pointerId": touchfor[i].identifier, "x": acrossWidthX.toFixed(2), "y": acrossHeightY.toFixed(2) }, "type": "event" } :
+        { "data": { "action": 1, "count": ongoingTouches.length, "pointerId": touchfor[i].identifier, "x": verticalWidthX.toFixed(2), "y": verticalHeightY.toFixed(2) }, "type": "event" };
       console.log(ping);
       wsss.send(JSON.stringify(ping));
       ongoingTouches.forEach(function (item, index) {
@@ -237,8 +237,8 @@ var draw_graph = function (graphType, obj) {
       var verticalWidthX = touchfor[i].pageX * (videoWidth / vowidth);
       var verticalHeightY = touchfor[i].pageY * (videoHeight / voheight);
       var ping = resolving == 0 ?
-        { "data": { "action": 2, "count": touchfor.length, "id": touchfor[i].identifier, "x": acrossWidthX.toFixed(2), "y": acrossHeightY.toFixed(2) }, "type": "event" } :
-        { "data": { "action": 2, "count": touchfor.length, "id": touchfor[i].identifier, "x": verticalWidthX.toFixed(2), "y": verticalHeightY.toFixed(2) }, "type": "event" };
+        { "data": { "action": 2, "count": touchfor.length, "pointerId": touchfor[i].identifier, "x": acrossWidthX.toFixed(2), "y": acrossHeightY.toFixed(2) }, "type": "event" } :
+        { "data": { "action": 2, "count": touchfor.length, "pointerId": touchfor[i].identifier, "x": verticalWidthX.toFixed(2), "y": verticalHeightY.toFixed(2) }, "type": "event" };
       console.log(ping);
       wsss.send(JSON.stringify(ping));
     }