public override void ApplyLayout(LayoutGraph graph) { ApplyLayoutCore(graph); foreach (Node n in graph.Nodes) { foreach (Edge e in n.OutEdges) { bool lastSegmentOverlap = false; IEdgeLayout er = graph.GetLayout(e); if (er.PointCount() > 0) { // last bend point YPoint bendPoint = er.GetPoint(er.PointCount() - 1); IEnumerator <Edge> ecc = n.OutEdges.GetEnumerator(); loop : while (ecc.MoveNext()) { Edge eccEdge = ecc.Current; if (eccEdge != e) { YPointPath path = graph.GetPath(eccEdge); for (ILineSegmentCursor lc = path.LineSegments(); lc.Ok; lc.Next()) { LineSegment seg = lc.LineSegment; if (seg.Contains(bendPoint)) { lastSegmentOverlap = true; goto loop; } } } } } YList points = graph.GetPointList(e); for (ListCell c = points.FirstCell; c != null; c = c.Succ()) { YPoint p = (YPoint)c.Info; if (c.Succ() == null && !lastSegmentOverlap) { break; } YPoint p0 = (YPoint)(c.Pred() == null ? graph.GetSourcePointAbs(e) : c.Pred().Info); YPoint p2; if (Math.Abs(p0.X - p.X) < 0.01) { p2 = new YPoint(p.X, p.Y - 0.001); } else { p2 = new YPoint(p.X - 0.001, p.Y); } points.InsertBefore(p2, c); } graph.SetPoints(e, points); } } }