Skip to content

Commit ac5038a

Browse files
author
chenhaohan
committed
fix: straighten and align the nodes on parallel branches
1 parent 25649ef commit ac5038a

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/GraphSharp/Algorithms/Layout/Simple/Hierarchical/EfficientSugiyamaLayoutAlgorithm.HorizontalAssignment.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Text;
@@ -414,14 +414,16 @@ private void DoAlignment(int modeIndex, LeftRightMode leftRightMode, UpperLowerE
414414
//align the segment of the PVertex
415415
vertex.Roots[modeIndex] = vertex.Segment.QVertex.Roots[modeIndex];
416416
vertex.Aligns[modeIndex] = vertex.Roots[modeIndex];
417-
r = vertex.Segment.Position;
417+
// Do not update r to avoid affecting the alignment of ordinary nodes in the same layer.
418+
// r = vertex.Segment.Position;
418419
}
419420
else if (vertex.Type == VertexTypes.QVertex /*&& upperLowerEdges == UpperLowerEdges.Upper*/)
420421
{
421422
//align the segment of the QVertex
422423
vertex.Roots[modeIndex] = vertex.Segment.PVertex.Roots[modeIndex];
423424
vertex.Aligns[modeIndex] = vertex.Roots[modeIndex];
424-
r = vertex.Segment.Position;
425+
// Do not update r to avoid affecting the alignment of ordinary nodes in the same layer.
426+
// r = vertex.Segment.Position;
425427
}
426428
}
427429
}

0 commit comments

Comments
 (0)