consider text containers as label-less when adjusting edges for dagre

This commit is contained in:
Gavin Nishizawa 2023-03-14 15:00:59 -07:00
parent 2f10ab754d
commit 9e31f83b7b
No known key found for this signature in database
GPG key ID: AE3B177777CE55CD

View file

@ -467,7 +467,7 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err
// if an edge to a container runs into its label, stop the edge at the label instead
overlapsContainerLabel := false
if edge.Dst.IsContainer() && edge.Dst.Attributes.Label.Value != "" {
if edge.Dst.IsContainer() && edge.Dst.Attributes.Label.Value != "" && !dstShape.Is(shape.TEXT_TYPE) {
// assumes LabelPosition, LabelWidth, LabelHeight are all set if there is a label
labelWidth := float64(*edge.Dst.LabelWidth)
labelHeight := float64(*edge.Dst.LabelHeight)