Skip to content

Commit d098806

Browse files
committed
fix routing with clusters
Signed-off-by: Lev Nachmanson <[email protected]>
1 parent c89d00a commit d098806

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

GraphLayout/MSAGL/Routing/ShapeCreator.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@ public static IEnumerable<Shape> GetShapes(GeometryGraph graph)
3434
}
3535

3636
private static void GetShapesOnDict(Dictionary<Node, Shape> nodesToShapes, Cluster c) {
37-
if (c.IsCollapsed) return;
3837
nodesToShapes.TryGetValue(c, out Shape cShape);
3938
if (cShape == null) {
40-
cShape= nodesToShapes[c] = CreateShapeWithClusterBoundaryPort(c);
39+
cShape = nodesToShapes[c] = CreateShapeWithClusterBoundaryPort(c);
4140
}
41+
if (c.IsCollapsed) return;
42+
4243
foreach (var n in c.Nodes) {
4344
nodesToShapes.TryGetValue(n, out Shape nShape);
4445
if (nShape == null) {

GraphLayout/MSAGL/Routing/SplineRouter.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,7 @@ public class SplineRouter : AlgorithmBase {
3434
Shape[] rootShapes;
3535
IEnumerable<EdgeGeometry> edgeGeometriesEnumeration {
3636
get {
37-
if (this._edges != null) {
38-
foreach (var item in this._edges.Select(e => e.EdgeGeometry)) {
39-
yield return item;
40-
}
41-
}
37+
return this._edges?.Select(e => e.EdgeGeometry) ?? Enumerable.Empty<EdgeGeometry>();
4238
}
4339
}
4440
double coneAngle;

0 commit comments

Comments
 (0)