Fix edges on create graph from matrix.

This commit is contained in:
Oleg Sh 2022-03-06 21:06:01 +02:00
parent 0904a350ca
commit 1eaa035cc5

View File

@ -580,6 +580,7 @@ Graph.prototype.SetAdjacencyMatrix = function (matrix, viewportSize, currentEnum
if (cols[i][j] > 0) if (cols[i][j] > 0)
{ {
var nEdgeIndex = this.AddNewEdgeSafe(this.vertices[i], this.vertices[j], cols[i][j] != cols[j][i], cols[i][j], true); var nEdgeIndex = this.AddNewEdgeSafe(this.vertices[i], this.vertices[j], cols[i][j] != cols[j][i], cols[i][j], true);
this.FixEdgeCurved(nEdgeIndex);
if (nEdgeIndex >= 0) if (nEdgeIndex >= 0)
{ {
bWeightGraph = bWeightGraph || this.edges[nEdgeIndex].weight != 1; bWeightGraph = bWeightGraph || this.edges[nEdgeIndex].weight != 1;