fix empty grid

This commit is contained in:
Gavin Nishizawa 2023-09-21 16:33:32 -07:00
parent 538d6920c8
commit 6d39f96a73
No known key found for this signature in database
GPG key ID: AE3B177777CE55CD

View file

@ -67,8 +67,12 @@ func LayoutNested(ctx context.Context, g *d2graph.Graph, graphInfo GraphInfo, co
for _, e := range nestedGraph.Edges {
e.Move(dx, dy)
}
} else if !gi.isDefault() {
// empty grid can have 0 objects..
if gi.DiagramType == GridDiagram && !gi.IsConstantNear && len(curr.Children) == 0 {
continue
}
extractedInfo[curr] = gi
// There is a nested diagram here, so extract its contents and process in the same way