Browse Source

fix previous commit

websocket-ui
Jeff Becker 8 years ago
parent
commit
3ecd9f05e4
No known key found for this signature in database
GPG Key ID: AB950234D6EA286B
  1. 15
      websocket-ui/ui.js

15
websocket-ui/ui.js

@ -248,6 +248,7 @@ setInterval(function() { @@ -248,6 +248,7 @@ setInterval(function() {
}
var newPeers = {};
var counter = 0;
for ( var ed in e ) {
var edge = e[ed];
draw.beginPath();
@ -255,12 +256,18 @@ setInterval(function() { @@ -255,12 +256,18 @@ setInterval(function() {
draw.lineWidth = edge[3];
draw.moveTo(edge[0].x * c.width, edge[0].y * c.height);
draw.lineTo(edge[1].x * c.width, edge[1].y * c.height);
newPeers[edge[0].name] = edge[0];
newPeers[edge[1].name] = edge[1];
if(!newPeers[edge[0].name]) {
newPeers[edge[0].name] = edge[0];
counter ++;
}
if(!newPeers[edge[1].name]) {
newPeers[edge[1].name] = edge[1];
counter ++;
}
draw.stroke();
}
peers = newPeers;
newPeers.length = counter;
tpeers = newPeers;

Loading…
Cancel
Save