diff --git a/d2layouts/d2dagrelayout/layout.go b/d2layouts/d2dagrelayout/layout.go index fd2423644..e7776d0b7 100644 --- a/d2layouts/d2dagrelayout/layout.go +++ b/d2layouts/d2dagrelayout/layout.go @@ -394,6 +394,8 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err q = q[1:] stepSize := subtract + // The object itself needs to move down the height it was just subtracted + // all descendents move half, to maintain vertical padding if curr != obj { stepSize /= 2. }