diff options
author | mattpiwik <matthieu.aubry@gmail.com> | 2011-04-20 06:10:24 +0400 |
---|---|---|
committer | mattpiwik <matthieu.aubry@gmail.com> | 2011-04-20 06:10:24 +0400 |
commit | 4fa378a5cb4da9bce530bfbbc45bf83eae9e7bbf (patch) | |
tree | bd51e002006b7b093bbdf7faff37b4a24d4e602e /core/ReportRenderer/Pdf.php | |
parent | c101ba5b3b8262e0fa8f8dfb391bfa54c52078ba (diff) |
fix ugly icons when country report displayed first was messing up the class members
git-svn-id: http://dev.piwik.org/svn/trunk@4520 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/ReportRenderer/Pdf.php')
-rw-r--r-- | core/ReportRenderer/Pdf.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/core/ReportRenderer/Pdf.php b/core/ReportRenderer/Pdf.php index 6a6d5b09bc..b5307af633 100644 --- a/core/ReportRenderer/Pdf.php +++ b/core/ReportRenderer/Pdf.php @@ -214,6 +214,9 @@ class Piwik_ReportRenderer_Pdf extends Piwik_ReportRenderer $posY = $posX = 0; $leftSpacesBeforeLogo = str_repeat(' ', $this->leftSpacesBeforeLogo); + $logoWidth = $this->logoWidth; + $logoHeight = $this->logoHeight; + // Draw a body of report table foreach($this->report as $rowId => $row) { @@ -246,11 +249,11 @@ class Piwik_ReportRenderer_Pdf extends Piwik_ReportRenderer { if(isset($this->reportRowsMetadata[$rowId]['logoWidth'])) { - $this->logoWidth = $this->reportRowsMetadata[$rowId]['logoWidth']; + $logoWidth = $this->reportRowsMetadata[$rowId]['logoWidth']; } if(isset($this->reportRowsMetadata[$rowId]['logoHeight'])) { - $this->logoHeight = $this->reportRowsMetadata[$rowId]['logoHeight']; + $logoHeight = $this->reportRowsMetadata[$rowId]['logoHeight']; } $restoreY = $this->TCPDF->getY(); $restoreX = $this->TCPDF->getX(); @@ -258,11 +261,11 @@ class Piwik_ReportRenderer_Pdf extends Piwik_ReportRenderer $this->TCPDF->SetX($posX ); $topMargin = 1.3; // Country flags are not very high, force a bigger top margin - if($this->logoHeight < 16) + if($logoHeight < 16) { $topMargin = 2; } - $this->TCPDF->Image(Piwik_Common::getPathToPiwikRoot()."/".$this->reportRowsMetadata[$rowId]['logo'], $posX + ($leftMargin = 2), $posY + $topMargin, $this->logoWidth/4); + $this->TCPDF->Image(Piwik_Common::getPathToPiwikRoot()."/".$this->reportRowsMetadata[$rowId]['logo'], $posX + ($leftMargin = 2), $posY + $topMargin, $logoWidth/4); $this->TCPDF->SetXY($restoreX, $restoreY); } } |