From 9e31f83b7b78b6b45a89972f7cde523cfa3adb78 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Tue, 14 Mar 2023 15:00:59 -0700 Subject: [PATCH] consider text containers as label-less when adjusting edges for dagre --- d2layouts/d2dagrelayout/layout.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d2layouts/d2dagrelayout/layout.go b/d2layouts/d2dagrelayout/layout.go index 3683051d6..dec8c164e 100644 --- a/d2layouts/d2dagrelayout/layout.go +++ b/d2layouts/d2dagrelayout/layout.go @@ -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)