diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-07-30 14:02:26 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-07-30 14:02:26 +0000 |
commit | 1ee0dff6548f8be54bf32fd5628e1bcd4c663fec (patch) | |
tree | 22be02f918f60f153908a251061aa4cde030a641 /src/element | |
parent | 35af5d844d58ff31386b6ad4b3450b4e5c040984 (diff) | |
download | zetacomponents-graph-1ee0dff6548f8be54bf32fd5628e1bcd4c663fec.zip zetacomponents-graph-1ee0dff6548f8be54bf32fd5628e1bcd4c663fec.tar.gz |
- Fixed borders for title element
Diffstat (limited to 'src/element')
-rw-r--r-- | src/element/text.php | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/src/element/text.php b/src/element/text.php index 24fee8e..e08b482 100644 --- a/src/element/text.php +++ b/src/element/text.php @@ -36,14 +36,6 @@ class ezcGraphChartElementText extends ezcGraphChartElement return $boundings; } - $boundings = $renderer->drawBox( - $boundings, - $this->background, - $this->border, - $this->borderWidth, - $this->margin, - $this->padding - ); $height = (int) min( round( $this->maxHeight * ( $boundings->y1 - $boundings->y0 ) ), @@ -53,33 +45,40 @@ class ezcGraphChartElementText extends ezcGraphChartElement switch ( $this->position ) { case ezcGraph::TOP: - $renderer->drawText( - new ezcGraphBoundings( - $boundings->x0, - $boundings->y0, - $boundings->x1, - $boundings->y0 + $height - ), - $this->title, - ezcGraph::CENTER | ezcGraph::MIDDLE + $textBoundings = new ezcGraphBoundings( + $boundings->x0, + $boundings->y0, + $boundings->x1, + $boundings->y0 + $height ); - $boundings->y0 += $height + $this->margin; break; case ezcGraph::BOTTOM: - $renderer->drawText( - new ezcGraphBoundings( - $boundings->x0, - $boundings->y1 - $height, - $boundings->x1, - $boundings->y1 - ), - $this->title, - ezcGraph::CENTER | ezcGraph::MIDDLE + $textBoundings = new ezcGraphBoundings( + $boundings->x0, + $boundings->y1 - $height, + $boundings->x1, + $boundings->y1 ); $boundings->y1 -= $height + $this->margin; break; } + + $textBoundings = $renderer->drawBox( + $textBoundings, + $this->background, + $this->border, + $this->borderWidth, + $this->margin, + $this->padding + ); + + $renderer->drawText( + $textBoundings, + $this->title, + ezcGraph::CENTER | ezcGraph::MIDDLE + ); + return $boundings; } } |