Browse Source

fix(云机): 修复触控坐标偏移。

zengzhixiang 2 years ago
parent
commit
2052f25259
1 changed files with 3 additions and 3 deletions
  1. 3 3
      static/screenIos/WXdraw.js

+ 3 - 3
static/screenIos/WXdraw.js

@@ -260,7 +260,7 @@ var draw_graph = function (graphType) {
       var verticalWidthX =
         touchfor[i].pageX * (window.currentPhoneSize.width / vowidth);
       var verticalHeightY =
-        touchfor[i].pageY * (window.currentPhoneSize.width / voheight);
+        touchfor[i].pageY * (window.currentPhoneSize.height / voheight);
       var idx = ongoingTouches.findIndex(function (ele) {
         return ele.identifier === touchfor[i].identifier;
       });
@@ -340,8 +340,8 @@ var draw_graph = function (graphType) {
       //   videoWidth - touchfor[i].pageX * (videoWidth / vowidth);
       var verticalWidthX =
         touchfor[i].pageX * (window.currentPhoneSize.width / vowidth);
-      var verticalHeightY = touchfor[i].pageY * (videoHeight / voheight);
-      window.currentPhoneSize.height;
+      var verticalHeightY =
+        touchfor[i].pageY * (window.currentPhoneSize.height / voheight);
       var ping =
         // resolving == 0 ?
         //   { "data": { "action": 2, "count": touchfor.length, "pointerId": touchfor[i].identifier, "x": acrossWidthX.toFixed(2), "y": acrossHeightY.toFixed(2) }, "type": "event" } :