From 3bdca8a4d99d4644381f0c8142d441a904b8ed21 Mon Sep 17 00:00:00 2001 From: makitso Date: Wed, 14 May 2014 11:04:46 -0500 Subject: Correct pedigree vertical line spacing when more than 5 generations --- library/WT/Controller/Familybook.php | 26 +++++++++++++--------- library/WT/Controller/Hourglass.php | 42 +++++++++++++++++++++++++++--------- 2 files changed, 48 insertions(+), 20 deletions(-) (limited to 'library') diff --git a/library/WT/Controller/Familybook.php b/library/WT/Controller/Familybook.php index e146c8fadd..e151421509 100644 --- a/library/WT/Controller/Familybook.php +++ b/library/WT/Controller/Familybook.php @@ -278,12 +278,15 @@ class WT_Controller_Familybook extends WT_Controller_Chart { echo ''; } else { echo ''; - for ($i=$count; $i<$genoffset-1; $i++) { + if ($count<$genoffset-1) { echo ''; - $this->printEmptyBox($bwidth, $bheight); - echo ''; - $this->printEmptyBox($bwidth, $bheight); - echo '
'; + for ($i=$count; $i<(pow(2, ($genoffset-1)-$count)/2)+2; $i++) { + $this->printEmptyBox($bwidth, $bheight); + echo ''; + $this->printEmptyBox($bwidth, $bheight); + echo ''; + } + echo ''; } } echo '', @@ -300,12 +303,15 @@ class WT_Controller_Familybook extends WT_Controller_Chart { echo ''; } else { echo ''; - for ($i=$count; $i<$genoffset-1; $i++) { + if ($count<$genoffset-1) { echo ''; - $this->printEmptyBox($bwidth, $bheight); - echo ''; - $this->printEmptyBox($bwidth, $bheight); - echo '
'; + for ($i=$count; $i<(pow(2, ($genoffset-1)-$count)/2)+2; $i++) { + $this->printEmptyBox($bwidth, $bheight); + echo ''; + $this->printEmptyBox($bwidth, $bheight); + echo ''; + } + echo ''; } } echo '', diff --git a/library/WT/Controller/Hourglass.php b/library/WT/Controller/Hourglass.php index 2c55b6ca49..7c2b6d2416 100644 --- a/library/WT/Controller/Hourglass.php +++ b/library/WT/Controller/Hourglass.php @@ -159,17 +159,29 @@ class WT_Controller_Hourglass extends WT_Controller_Chart { //-- recursively get the father’s family $this->print_person_pedigree($family->getHusband(), $count+1); echo ""; + } else { + echo ''; + if ($count<$genoffset-1) { + echo ''; + for ($i=$count; $i<(pow(2, ($genoffset-1)-$count)/2)+2; $i++) { + $this->printEmptyBox($bwidth, $bheight); + echo ''; + $this->printEmptyBox($bwidth, $bheight); + echo ''; + } + echo '
'; + } } - echo ""; - echo "\"\""; - echo "\"\""; - echo ""; + echo '', + '', + '', + ''; //-- print the mother box print_pedigree_person($family->getWife()); - echo ""; + echo ''; if ($family->getWife()) { $ARID = $family->getWife()->getXref(); - echo ""; + echo ''; //-- print an ajax arrow on the last generation of the adult female if ($count==$this->generations-1 && $family->getWife()->getChildFamilies()) { @@ -178,14 +190,24 @@ class WT_Controller_Hourglass extends WT_Controller_Chart { //-- recursively print the mother’s family $this->print_person_pedigree($family->getWife(), $count+1); - echo ""; + echo ''; } - echo ""; - echo ""; + echo '', + ''; break; } } - + /** + * Print empty box + */ + function printEmptyBox($bwidth, $bheight){ + echo '', + '', + '
', + '', + ''; + } + /** * Prints descendency of passed in person * -- cgit v1.3