This commit is contained in:
Gavin Nishizawa 2023-09-18 20:12:50 -07:00
parent 96254b56ed
commit bff1e0b066
No known key found for this signature in database
GPG key ID: AE3B177777CE55CD

View file

@ -44,14 +44,7 @@ func LayoutNested(ctx context.Context, g *d2graph.Graph, graphInfo GraphInfo, co
// Iterate top-down from Root so all nested diagrams can process their own contents // Iterate top-down from Root so all nested diagrams can process their own contents
queue := make([]*d2graph.Object, 0, len(g.Root.ChildrenArray)) queue := make([]*d2graph.Object, 0, len(g.Root.ChildrenArray))
if graphInfo.IsConstantNear { queue = append(queue, g.Root.ChildrenArray...)
near := g.Root.ChildrenArray[0]
if len(near.Children) > 0 {
queue = append(queue, near.ChildrenArray...)
}
} else {
queue = append(queue, g.Root.ChildrenArray...)
}
for _, child := range queue { for _, child := range queue {
if gi := NestedGraphInfo(child); !gi.isDefault() { if gi := NestedGraphInfo(child); !gi.isDefault() {