This commit is contained in:
Gavin Nishizawa 2023-09-12 22:04:57 -07:00
parent d651c3eb63
commit f4b153d059
No known key found for this signature in database
GPG key ID: AE3B177777CE55CD
2 changed files with 4 additions and 3 deletions

View file

@ -123,7 +123,5 @@ func (gd *gridDiagram) cleanup(obj *d2graph.Object, graph *d2graph.Graph) {
restore(obj, child)
child.IterDescendants(restore)
}
for _, e := range gd.edges {
graph.Edges = append(graph.Edges, e)
}
graph.Edges = append(graph.Edges, gd.edges...)
}

View file

@ -84,6 +84,9 @@ func withoutGridDiagrams(ctx context.Context, g *d2graph.Graph, layout d2graph.L
sort.SliceStable(obj.ChildrenArray, func(i, j int) bool {
return objectOrder[obj.ChildrenArray[i].AbsID()] < objectOrder[obj.ChildrenArray[j].AbsID()]
})
sort.SliceStable(g.Edges, func(i, j int) bool {
return edgeOrder[g.Edges[i].AbsID()] < edgeOrder[g.Edges[j].AbsID()]
})
for _, o := range tempGraph.Objects {
toRemove[o] = struct{}{}