Skip to content

Commit

Permalink
fix routing with clusters
Browse files Browse the repository at this point in the history
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
  • Loading branch information
levnach committed Sep 18, 2024
1 parent c89d00a commit d098806
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 3 additions & 2 deletions GraphLayout/MSAGL/Routing/ShapeCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ public static IEnumerable<Shape> GetShapes(GeometryGraph graph)
}

private static void GetShapesOnDict(Dictionary<Node, Shape> nodesToShapes, Cluster c) {
if (c.IsCollapsed) return;
nodesToShapes.TryGetValue(c, out Shape cShape);
if (cShape == null) {
cShape= nodesToShapes[c] = CreateShapeWithClusterBoundaryPort(c);
cShape = nodesToShapes[c] = CreateShapeWithClusterBoundaryPort(c);
}
if (c.IsCollapsed) return;

foreach (var n in c.Nodes) {
nodesToShapes.TryGetValue(n, out Shape nShape);
if (nShape == null) {
Expand Down
6 changes: 1 addition & 5 deletions GraphLayout/MSAGL/Routing/SplineRouter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ public class SplineRouter : AlgorithmBase {
Shape[] rootShapes;
IEnumerable<EdgeGeometry> edgeGeometriesEnumeration {
get {
if (this._edges != null) {
foreach (var item in this._edges.Select(e => e.EdgeGeometry)) {
yield return item;
}
}
return this._edges?.Select(e => e.EdgeGeometry) ?? Enumerable.Empty<EdgeGeometry>();
}
}
double coneAngle;
Expand Down

0 comments on commit d098806

Please sign in to comment.