Skip to content

Commit 659266d

Browse files
903092: concerns addressed
1 parent efb8804 commit 659266d

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

blazor/diagram/layout/flowchart-layout.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,21 @@ Different flowchart symbols have different meanings that are used to represent d
5757
for (int i = 0; i < Diagram.Connectors.Count; i++)
5858
{
5959
var connector = Diagram.Connectors[i];
60+
var node = Diagram.GetObject(connector.TargetID) as Node;
61+
var srcNode = Diagram.GetObject(connector.SourceID) as Node;
62+
if (node.Data != null && node.Data is ItemInfo itemInfo)
6063
{
61-
var node = Diagram.GetObject(connector.TargetID) as Node;
62-
var srcNode = Diagram.GetObject(connector.SourceID) as Node;
63-
if (node.Data != null && node.Data is ItemInfo itemInfo)
64+
if (itemInfo.Label != null && itemInfo.Label.Count > 0)
6465
{
65-
if (itemInfo.Label != null && itemInfo.Label.Count > 0)
66+
if (itemInfo.ParentId.IndexOf((srcNode.Data as ItemInfo).Id) != -1)
6667
{
67-
if (itemInfo.ParentId.IndexOf((srcNode.Data as ItemInfo).Id) != -1)
68+
var parentIndex = itemInfo.ParentId.IndexOf((srcNode.Data as ItemInfo).Id);
69+
if (itemInfo.Label.Count > parentIndex)
6870
{
69-
var parentIndex = itemInfo.ParentId.IndexOf((srcNode.Data as ItemInfo).Id);
70-
if (itemInfo.Label.Count > parentIndex)
71+
connector.Annotations = new DiagramObjectCollection<PathAnnotation>()
7172
{
72-
connector.Annotations = new DiagramObjectCollection<PathAnnotation>()
73-
{
74-
new PathAnnotation() { Content = itemInfo.Label[parentIndex], Style = new TextStyle(){ Bold = true} }
75-
};
76-
}
73+
new PathAnnotation() { Content = itemInfo.Label[parentIndex], Style = new TextStyle(){ Bold = true} }
74+
};
7775
}
7876
}
7977
}

0 commit comments

Comments
 (0)