mirror of
https://github.com/nadrad/h-m-m.git
synced 2024-05-16 22:36:32 +02:00
fixed line when single child doesn't have same y
This commit is contained in:
parent
ecc0e21924
commit
eb12fad1c3
28
h-m-m
28
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<max($y1,$y2); $yy++)
|
||||
mput(
|
||||
$mm,
|
||||
$mm['nodes'][ $node['children'][0] ]['x'] - 2,
|
||||
$yy,
|
||||
'│'
|
||||
);
|
||||
|
||||
mput(
|
||||
$mm,
|
||||
$mm['nodes'][ $node['children'][0] ]['x'] - 2,
|
||||
$y2,
|
||||
( $y2 > $y1 ? '╰' : '╭' )
|
||||
);
|
||||
|
||||
mput(
|
||||
$mm,
|
||||
$mm['nodes'][ $node['children'][0] ]['x'] - 2,
|
||||
min($y1,$y2),
|
||||
( $y2 > $y1 ? '╮' : '╯' )
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
draw_connections($mm, $node['children'][0]);
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue