diff options
| author | Rob Peters <makitso@gmail.com> | 2011-11-19 16:02:11 +0000 |
|---|---|---|
| committer | Rob Peters <makitso@gmail.com> | 2011-11-19 16:02:11 +0000 |
| commit | d64d49d0d534ed58d3677e4f564c22882f2e0726 (patch) | |
| tree | 52a137e2eadf4b690a8835e0b6fc902ffdb948eb /library | |
| parent | fa86203ad3e5ab4aace03005cb36d249fcf083ba (diff) | |
| download | webtrees-d64d49d0d534ed58d3677e4f564c22882f2e0726.tar.gz webtrees-d64d49d0d534ed58d3677e4f564c22882f2e0726.tar.bz2 webtrees-d64d49d0d534ed58d3677e4f564c22882f2e0726.zip | |
This patch makes the charts that use person_box consistent in their height and width.
1.) These values are defined in the theme.php file. For those charts that have the % width option, the patch expands both height and width. For charts with the detailed checkbox unselected, the box size is a consistent percentage of the larger box.
2.) The name block is now set to 1/2 the box height.
Diffstat (limited to 'library')
| -rw-r--r-- | library/WT/Controller/Ancestry.php | 13 | ||||
| -rw-r--r-- | library/WT/Controller/Descendancy.php | 21 | ||||
| -rw-r--r-- | library/WT/Controller/Hourglass.php | 20 |
3 files changed, 32 insertions, 22 deletions
diff --git a/library/WT/Controller/Ancestry.php b/library/WT/Controller/Ancestry.php index f3cbae1335..df8879bb13 100644 --- a/library/WT/Controller/Ancestry.php +++ b/library/WT/Controller/Ancestry.php @@ -65,15 +65,16 @@ class WT_Controller_Ancestry extends WT_Controller_Chart { // Validate form parameters $this->rootid = check_rootid($this->rootid); - // -- size of the boxes - $Dbwidth*=$box_width/100; + // -- size of the detailed boxes based upon optional width parameter + $Dbwidth=($box_width*$bwidth)/100; + $Dbheight=($box_width*$bheight)/100; $bwidth=$Dbwidth; - if (!$this->show_full) { - $bwidth = $bwidth / 1.5; - } $bheight=$Dbheight; + + // -- adjust size of the non-detailed boxes if (!$this->show_full) { - $bheight = $bheight / 1.5; + $bwidth = $bwidth / 1.5; + $bheight = $bheight / 2 ; } $pbwidth = $bwidth+12; diff --git a/library/WT/Controller/Descendancy.php b/library/WT/Controller/Descendancy.php index 827092c23b..c5d9f15708 100644 --- a/library/WT/Controller/Descendancy.php +++ b/library/WT/Controller/Descendancy.php @@ -66,24 +66,25 @@ class WT_Controller_Descendancy extends WT_Controller_Chart { $this->chart_style=safe_GET_integer('chart_style', 0, 3, 0); $this->generations=safe_GET_integer('generations', 2, $MAX_DESCENDANCY_GENERATIONS, $DEFAULT_PEDIGREE_GENERATIONS); $this->box_width =safe_GET_integer('box_width', 50, 300, 100); + $box_width =safe_GET_integer('box_width', 50, 300, 100); // This is passed as a global. A parameter would be better... $show_full=$this->show_full; if (!isset($this->personcount)) $this->personcount = 1; - $this->Dbwidth*=$this->box_width/100; - - if (!$this->show_full) { - $bwidth *= $this->box_width / 150; - } else { - $bwidth*=$this->box_width/100; - } - + // -- size of the detailed boxes based upon optional width parameter + $Dbwidth=($box_width*$bwidth)/100; + $Dbheight=($box_width*$bheight)/100; + $bwidth=$Dbwidth; + $bheight=$Dbheight; + + // -- adjust size of the non-detailed boxes if (!$this->show_full) { - $bheight = $bheight / 1.5; + $bwidth = $bwidth / 1.5; + $bheight = $bheight / 2 ; } - + $pbwidth = $bwidth+12; $pbheight = $bheight+14; diff --git a/library/WT/Controller/Hourglass.php b/library/WT/Controller/Hourglass.php index b2920550b0..2ba3c5dddb 100644 --- a/library/WT/Controller/Hourglass.php +++ b/library/WT/Controller/Hourglass.php @@ -73,6 +73,7 @@ class WT_Controller_Hourglass extends WT_Controller_Chart { $this->show_spouse=safe_GET('show_spouse', array('0', '1'), '0'); $this->generations=safe_GET_integer('generations', 2, $MAX_DESCENDANCY_GENERATIONS, 3); $this->box_width =safe_GET_integer('box_width', 50, 300, 100); + $box_width =safe_GET_integer('box_width', 50, 300, 100); // This is passed as a global. A parameter would be better... $show_full=$this->show_full; @@ -91,14 +92,21 @@ class WT_Controller_Hourglass extends WT_Controller_Chart { $this->arrwidth = $temp[0]; $this->arrheight= $temp[1]; } + + // -- size of the detailed boxes based upon optional width parameter + $Dbwidth=($box_width*$bwidth)/100; + $Dbheight=($box_width*$bheight)/100; + $bwidth=$Dbwidth; + $bheight=$Dbheight; + + // -- adjust size of the non-detailed boxes + if (!$this->show_full) { + $bwidth = $bwidth / 1.5; + $bheight = $bheight / 2 ; + } - // -- Sets the sizes of the boxes - if (!$this->show_full) $bwidth *= $this->box_width / 150; - else $bwidth*=$this->box_width/100; - - if (!$this->show_full) $bheight = (int)($bheight / 2); $bhalfheight = (int)($bheight / 2); - + // Validate parameters $this->pid=check_rootid($this->pid); |
