mirror of
https://github.com/UnickSoft/graphonline.git
synced 2025-07-03 16:25:59 +00:00
hot fix remove vertex
This commit is contained in:
parent
af7e84f81a
commit
d114ab6fa9
@ -105,13 +105,11 @@ Graph.prototype.DeleteVertex = function(vertexObject)
|
|||||||
var index = this.vertices.indexOf(vertexObject);
|
var index = this.vertices.indexOf(vertexObject);
|
||||||
if (index > -1)
|
if (index > -1)
|
||||||
{
|
{
|
||||||
var clonedEdge = this.edges.slice(0);
|
for (var i = 0; i < this.edges.length; i++)
|
||||||
|
|
||||||
for (var i = 0; i < clonedEdge.length; i++)
|
|
||||||
{
|
{
|
||||||
if (clonedEdge[i].vertex1 == vertexObject || clonedEdge[i].vertex2 == vertexObject)
|
if (this.edges[i].vertex1 == vertexObject || this.edges[i].vertex2 == vertexObject)
|
||||||
{
|
{
|
||||||
this.DeleteEdge(clonedEdge[i]);
|
this.DeleteEdge(this.edges[i]);
|
||||||
i--;
|
i--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user