Add comment to addLifelineEdges

This commit is contained in:
Júlio César Batista 2022-11-25 22:41:11 -08:00
parent a430cc6e60
commit f3b7453c8a
No known key found for this signature in database
GPG key ID: 10C4B861BF314878

View file

@ -72,6 +72,15 @@ func routeEdges(edgesInOrder []*d2graph.Edge, startY, yStep float64) {
}
}
// addLifelineEdges adds a new edge for each object in the graph that represents the
// edge below he object showing its lifespan
// ┌──────────────┐
// │ object │
// └──────┬───────┘
// │
// │ lifeline
// │
// │
func addLifelineEdges(g *d2graph.Graph, objectsInOrder []*d2graph.Object, yStep float64) {
endY := g.Edges[len(g.Edges)-1].Route[0].Y + yStep
for _, obj := range objectsInOrder {