|
@@ -185,11 +185,16 @@ var draw_graph = function (graphType, obj) {
|
|
var acrossHeightY = videoWidth - touchfor[i].pageX * (videoWidth / vowidth);
|
|
var acrossHeightY = videoWidth - touchfor[i].pageX * (videoWidth / vowidth);
|
|
var verticalWidthX = touchfor[i].pageX * (videoWidth / vowidth);
|
|
var verticalWidthX = touchfor[i].pageX * (videoWidth / vowidth);
|
|
var verticalHeightY = touchfor[i].pageY * (videoHeight / voheight);
|
|
var verticalHeightY = touchfor[i].pageY * (videoHeight / voheight);
|
|
|
|
+ var idx = ongoingTouches.findIndex(function (ele) {
|
|
|
|
+ return ele.identifier === touchfor[i].identifier
|
|
|
|
+ })
|
|
|
|
+ if (idx < 0) {
|
|
|
|
+ ongoingTouches.push(touchfor[i]);
|
|
|
|
+ }
|
|
var ping = resolving == 0 ?
|
|
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": 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, "id": touchfor[i].identifier, "x": verticalWidthX.toFixed(2), "y": verticalHeightY.toFixed(2) }, "type": "event" };
|
|
console.log(ping);
|
|
console.log(ping);
|
|
- ongoingTouches.push(ping);
|
|
|
|
wsss.send(JSON.stringify(ping));
|
|
wsss.send(JSON.stringify(ping));
|
|
}
|
|
}
|
|
canDraw = true;
|
|
canDraw = true;
|
|
@@ -209,8 +214,8 @@ var draw_graph = function (graphType, obj) {
|
|
{ "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, "id": touchfor[i].identifier, "x": verticalWidthX.toFixed(2), "y": verticalHeightY.toFixed(2) }, "type": "event" };
|
|
console.log(ping);
|
|
console.log(ping);
|
|
wsss.send(JSON.stringify(ping));
|
|
wsss.send(JSON.stringify(ping));
|
|
- ongoingTouches.forEach(function(item, index) {
|
|
|
|
- if (item.id === touchfor[i].identifier) {
|
|
|
|
|
|
+ ongoingTouches.forEach(function (item, index) {
|
|
|
|
+ if (item.identifier === touchfor[i].identifier) {
|
|
ongoingTouches.splice(index, 1)
|
|
ongoingTouches.splice(index, 1)
|
|
}
|
|
}
|
|
})
|
|
})
|