fix sequence in grid cell
This commit is contained in:
parent
7cf4579a0f
commit
0129ec4497
1 changed files with 4 additions and 4 deletions
|
|
@ -96,10 +96,10 @@ func LayoutNested(ctx context.Context, g *d2graph.Graph, graphInfo GraphInfo, co
|
||||||
isGridCellContainer := graphInfo.DiagramType == GridDiagram &&
|
isGridCellContainer := graphInfo.DiagramType == GridDiagram &&
|
||||||
curr.IsContainer() && curr.Parent == g.Root
|
curr.IsContainer() && curr.Parent == g.Root
|
||||||
gi := NestedGraphInfo(curr)
|
gi := NestedGraphInfo(curr)
|
||||||
|
|
||||||
|
if isGridCellContainer && gi.isDefault() {
|
||||||
// if we are in a grid diagram, and our children have descendants
|
// if we are in a grid diagram, and our children have descendants
|
||||||
// we need to run layout on them first, even if they are not special diagram types
|
// we need to run layout on them first, even if they are not special diagram types
|
||||||
|
|
||||||
if isGridCellContainer {
|
|
||||||
nestedGraph := ExtractSubgraph(curr, true)
|
nestedGraph := ExtractSubgraph(curr, true)
|
||||||
err := LayoutNested(ctx, nestedGraph, GraphInfo{}, coreLayout)
|
err := LayoutNested(ctx, nestedGraph, GraphInfo{}, coreLayout)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -204,7 +204,7 @@ func LayoutNested(ctx context.Context, g *d2graph.Graph, graphInfo GraphInfo, co
|
||||||
PositionNested(n, nestedGraph)
|
PositionNested(n, nestedGraph)
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Warn(ctx, "done", slog.F("rootlevel", g.RootLevel))
|
log.Warn(ctx, "done", slog.F("rootlevel", g.RootLevel), slog.F("shapes", g.PrintString()))
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue