From eb12fad1c380b03a01d63268e5a8dfdd00bf2b71 Mon Sep 17 00:00:00 2001 From: nadrad Date: Tue, 30 Aug 2022 20:48:52 +0200 Subject: [PATCH] fixed line when single child doesn't have same y --- h-m-m | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/h-m-m b/h-m-m index 456af96..ea3998b 100755 --- a/h-m-m +++ b/h-m-m @@ -595,7 +595,7 @@ function draw_connections(&$mm, $id){ } - // if there's only one child + // if there's only one child in the same y coordinate if (count($node['children'])==1) { @@ -611,6 +611,32 @@ function draw_connections(&$mm, $id){ $mm['conn_single'] ); + if (abs($y1-$y2)>0) { + + for ($yy=min($y1,$y2); $yy $y1 ? '╰' : '╭' ) + ); + + mput( + $mm, + $mm['nodes'][ $node['children'][0] ]['x'] - 2, + min($y1,$y2), + ( $y2 > $y1 ? '╮' : '╯' ) + ); + + } + draw_connections($mm, $node['children'][0]); return;