diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-07-11 09:49:17 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-07-11 09:49:17 +0000 |
commit | 0e0f42c5fec14738ebd62abdb4b641083a580bf7 (patch) | |
tree | f0dc300552df9a82f9441f0fb315e37bfcbe4419 /src | |
parent | 41bf84471383c06a43d55acfce4170c21f738ebf (diff) | |
download | zetacomponents-graph-0e0f42c5fec14738ebd62abdb4b641083a580bf7.zip zetacomponents-graph-0e0f42c5fec14738ebd62abdb4b641083a580bf7.tar.gz |
- Fixed bounding calculation for legend
Diffstat (limited to 'src')
-rw-r--r-- | src/element/legend.php | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/element/legend.php b/src/element/legend.php index 06a6ab0..ed110f4 100644 --- a/src/element/legend.php +++ b/src/element/legend.php @@ -155,35 +155,33 @@ class ezcGraphChartElementLegend extends ezcGraphChartElement protected function calculateBoundings( ezcGraphBoundings $boundings ) { + $this->boundings = clone $boundings; + switch ( $this->position ) { case ezcGraph::TOP: - $this->boundings = clone $boundings; - $size = (int) round( $boundings->y0 + ( $boundings->y1 - $boundings->y0) * $this->landscapeSize ); - $this->boundings->y1 = $size; - $boundings->y0 = $size; + + $boundings->y0 += $size; + $this->boundings->y1 = $boundings->y0; break; case ezcGraph::LEFT: - $this->boundings = clone $boundings; - $size = (int) round( $boundings->x0 + ( $boundings->x1 - $boundings->x0) * $this->portraitSize ); - $this->boundings->x1 = $size; - $boundings->x0 = $size; + + $boundings->x0 += $size; + $this->boundings->x1 = $boundings->x0; break; case ezcGraph::RIGHT: - $this->boundings = clone $boundings; - $size = (int) round( $boundings->x1 - ( $boundings->x1 - $boundings->x0) * $this->portraitSize ); - $this->boundings->x0 = $size; - $boundings->x1 = $size; + + $boundings->x1 -= $size; + $this->boundings->x0 = $boundings->x1; break; case ezcGraph::BOTTOM: - $this->boundings = clone $boundings; - $size = (int) round( $boundings->y1 - ( $boundings->y1 - $boundings->y0) * $this->landscapeSize ); - $this->boundings->y0 = $size; - $boundings->y1 = $size; + + $boundings->y1 -= $size; + $this->boundings->y0 = $boundings->y1; break; } @@ -211,24 +209,26 @@ class ezcGraphChartElementLegend extends ezcGraphChartElement } // Render standard elements - $boundings = $renderer->drawBox( - $boundings, + $this->boundings = $renderer->drawBox( + $this->boundings, $this->background, $this->border, $this->borderWidth, $this->margin, $this->padding, $this->title, - $this->getTitleSize( $boundings, $type ) + $this->getTitleSize( $this->boundings, $type ) ); // Render legend $renderer->drawLegend( - $boundings, + $this->boundings, $this, $type ); + var_dump( $this->boundings, $boundings ); + return $boundings; } } |