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. 11
      websocket-ui/ui.js

11
websocket-ui/ui.js

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

Loading…
Cancel
Save