fix layout of grid in constant near

This commit is contained in:
Gavin Nishizawa 2023-04-10 10:34:12 -07:00
parent 4bfbaba301
commit 5543828020
No known key found for this signature in database
GPG key ID: AE3B177777CE55CD

View file

@ -71,15 +71,15 @@ func compile(ctx context.Context, g *d2graph.Graph, opts *CompileOptions) (*d2ta
constantNearGraphs := d2near.WithoutConstantNears(ctx, g)
layoutWithGrids := d2grid.Layout(ctx, g, coreLayout)
// run core layout for constantNears
for _, tempGraph := range constantNearGraphs {
if err = coreLayout(ctx, tempGraph); err != nil {
if err = layoutWithGrids(ctx, tempGraph); err != nil {
return nil, err
}
}
layoutWithGrids := d2grid.Layout(ctx, g, coreLayout)
err = d2sequence.Layout(ctx, g, layoutWithGrids)
if err != nil {
return nil, err