From b40c54715b1d9312829dd4f23161d7834e021134 Mon Sep 17 00:00:00 2001 From: Cristiano Migali Date: Tue, 1 Sep 2020 19:25:12 +0200 Subject: [PATCH] adding a single comment missed in last commit --- tree/stringify.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tree/stringify.go b/tree/stringify.go index 5577908..f19c4bb 100644 --- a/tree/stringify.go +++ b/tree/stringify.go @@ -171,9 +171,11 @@ func stringify(t *Tree) *drawer.Drawer { log.Fatal(fmt.Errorf("childrenMiddle is not sorted")) } + // w is the width of the final drawer and is equal to the maximum between dValW+2 and childrenW var w int if dValW+2 > childrenW { w = dValW + 2 + // If parent width is greater than children width, children get centered by shifing each child for i := 0; i < nChildren; i++ { childrenLeft[i] += (w - childrenW) / 2 childrenMiddle[i] += (w - childrenW) / 2