summaryrefslogtreecommitdiffstats
path: root/src/element
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-07-30 14:02:26 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-07-30 14:02:26 +0000
commit1ee0dff6548f8be54bf32fd5628e1bcd4c663fec (patch)
tree22be02f918f60f153908a251061aa4cde030a641 /src/element
parent35af5d844d58ff31386b6ad4b3450b4e5c040984 (diff)
downloadzetacomponents-graph-1ee0dff6548f8be54bf32fd5628e1bcd4c663fec.zip
zetacomponents-graph-1ee0dff6548f8be54bf32fd5628e1bcd4c663fec.tar.gz
- Fixed borders for title element
Diffstat (limited to 'src/element')
-rw-r--r--src/element/text.php53
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;
}
}
OpenPOWER on IntegriCloud