diff options
| author | makitso <makitso@gmail.com> | 2014-05-14 11:04:46 -0500 |
|---|---|---|
| committer | makitso <makitso@gmail.com> | 2014-05-14 11:04:46 -0500 |
| commit | 3bdca8a4d99d4644381f0c8142d441a904b8ed21 (patch) | |
| tree | 831b5d157f83e4f1c528bebf0e00568d7ee3a91d /library | |
| parent | f54235228e1f8e6c481ab7b123a8f20ae6efca39 (diff) | |
| download | webtrees-3bdca8a4d99d4644381f0c8142d441a904b8ed21.tar.gz webtrees-3bdca8a4d99d4644381f0c8142d441a904b8ed21.tar.bz2 webtrees-3bdca8a4d99d4644381f0c8142d441a904b8ed21.zip | |
Correct pedigree vertical line spacing when more than 5 generations
Diffstat (limited to 'library')
| -rw-r--r-- | library/WT/Controller/Familybook.php | 26 | ||||
| -rw-r--r-- | library/WT/Controller/Hourglass.php | 42 |
2 files changed, 48 insertions, 20 deletions
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 '</td>'; } else { echo '<td>'; - for ($i=$count; $i<$genoffset-1; $i++) { + if ($count<$genoffset-1) { echo '<table>'; - $this->printEmptyBox($bwidth, $bheight); - echo '</tr>'; - $this->printEmptyBox($bwidth, $bheight); - echo '</tr></table>'; + for ($i=$count; $i<(pow(2, ($genoffset-1)-$count)/2)+2; $i++) { + $this->printEmptyBox($bwidth, $bheight); + echo '</tr>'; + $this->printEmptyBox($bwidth, $bheight); + echo '</tr>'; + } + echo '</table>'; } } echo '</tr><tr>', @@ -300,12 +303,15 @@ class WT_Controller_Familybook extends WT_Controller_Chart { echo '</td>'; } else { echo '<td>'; - for ($i=$count; $i<$genoffset-1; $i++) { + if ($count<$genoffset-1) { echo '<table>'; - $this->printEmptyBox($bwidth, $bheight); - echo '</tr>'; - $this->printEmptyBox($bwidth, $bheight); - echo '</tr></table>'; + for ($i=$count; $i<(pow(2, ($genoffset-1)-$count)/2)+2; $i++) { + $this->printEmptyBox($bwidth, $bheight); + echo '</tr>'; + $this->printEmptyBox($bwidth, $bheight); + echo '</tr>'; + } + echo '</table>'; } } echo '</tr>', 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 "</td>"; + } else { + echo '<td>'; + if ($count<$genoffset-1) { + echo '<table>'; + for ($i=$count; $i<(pow(2, ($genoffset-1)-$count)/2)+2; $i++) { + $this->printEmptyBox($bwidth, $bheight); + echo '</tr>'; + $this->printEmptyBox($bwidth, $bheight); + echo '</tr>'; + } + echo '</table>'; + } } - echo "</tr><tr>"; - echo "<td valign=\"top\"><img name=\"pvline\" src=\"".$WT_IMAGES["vline"]."\" width=\"3\" height=\"$lh\" alt=\"\"></td>"; - echo "<td><img class=\"line4\" src=\"".$WT_IMAGES["hline"]."\" width=\"7\" height=\"3\" alt=\"\"></td>"; - echo "<td>"; + echo '</tr><tr>', + '<td valign="top"><img name="pvline" src="'.$WT_IMAGES["vline"].'" width="3" height="$lh" alt=""></td>', + '<td><img class="line4" src="'.$WT_IMAGES["hline"].'" width="7" height="3" alt=""></td>', + '<td>'; //-- print the mother box print_pedigree_person($family->getWife()); - echo "</td>"; + echo '</td>'; if ($family->getWife()) { $ARID = $family->getWife()->getXref(); - echo "<td id=\"td_".$ARID."\">"; + echo '<td id="td_'.$ARID.'">'; //-- 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 "</td>"; + echo '</td>'; } - echo "</tr>"; - echo "</table>"; + echo '</tr>', + '</table>'; break; } } - + /** + * Print empty box + */ + function printEmptyBox($bwidth, $bheight){ + echo '<tr>', + '<td>', + '<div style="width:',$bwidth+16,'px; height:',$bheight+8,'px;"></div>', + '</td>', + '<td>'; + } + /** * Prints descendency of passed in person * |
