summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2007-04-05 09:26:22 +0000
committerKore Nordmann <github@kore-nordmann.de>2007-04-05 09:26:22 +0000
commit0595ae170c3c418625f8d7ede4a878209fe7c869 (patch)
treec0331cf7868505359ecfea8dc4ba5f9de300c7ed /src
parent7718b08b9e1e34023e6bfe20460c3a438349965c (diff)
downloadzetacomponents-graph-0595ae170c3c418625f8d7ede4a878209fe7c869.zip
zetacomponents-graph-0595ae170c3c418625f8d7ede4a878209fe7c869.tar.gz
- Implemented text rotation in flash driver
Diffstat (limited to 'src')
-rw-r--r--src/driver/flash.php30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/driver/flash.php b/src/driver/flash.php
index 1ce2693..409b107 100644
--- a/src/driver/flash.php
+++ b/src/driver/flash.php
@@ -314,6 +314,7 @@ class ezcGraphFlashDriver extends ezcGraphDriver
'height' => $height,
'align' => $align,
'font' => $this->options->font,
+ 'rotation' => $rotation,
);
}
else
@@ -334,10 +335,10 @@ class ezcGraphFlashDriver extends ezcGraphDriver
* @param ezcGraphColor $color Font color
* @param ezcGraphCoordinate $position Position
* @param float $size Textsize
- * @param ezcGraphColor $color Textcolor
+ * @param ezcGraphRotation $rotation
* @return void
*/
- protected function renderText( $id, $text, $chars, $type, $path, ezcGraphColor $color, ezcGraphCoordinate $position, $size )
+ protected function renderText( $id, $text, $chars, $type, $path, ezcGraphColor $color, ezcGraphCoordinate $position, $size, $rotation = null )
{
$movie = $this->getDocument();
@@ -349,7 +350,16 @@ class ezcGraphFlashDriver extends ezcGraphDriver
$tb->addChars( $chars );
$object = $movie->add( $tb );
- $object->moveTo( $position->x, $position->y - $size * ( 1 + $this->options->lineSpacing ) );
+ $object->rotate(
+ ( $rotation !== null ? -$rotation->getRotation() : 0 )
+ );
+ $object->moveTo(
+ $position->x +
+ ( $rotation === null ? 0 : $this->modifyCoordinate( $rotation->get( 0, 2 ) ) ),
+ $position->y -
+ $size * ( 1 + $this->options->lineSpacing ) +
+ ( $rotation === null ? 0 : $this->modifyCoordinate( $rotation->get( 1, 2 ) ) )
+ );
$object->setName( $id );
}
@@ -483,6 +493,14 @@ class ezcGraphFlashDriver extends ezcGraphDriver
);
}
+ if ( $text['rotation'] !== null )
+ {
+ foreach ( $borderPolygonArray as $nr => $point )
+ {
+ $borderPolygonArray[$nr] = $text['rotation']->transformCoordinate( $point );
+ }
+ }
+
if ( $text['font']->background !== false )
{
$this->drawPolygon(
@@ -547,7 +565,8 @@ class ezcGraphFlashDriver extends ezcGraphDriver
$position->x + $this->modifyCoordinate( $text['font']->textShadowOffset ),
$position->y + $this->modifyCoordinate( $text['font']->textShadowOffset )
),
- $size
+ $size,
+ $text['rotation']
);
}
@@ -560,7 +579,8 @@ class ezcGraphFlashDriver extends ezcGraphDriver
$text['font']->path,
$text['font']->color,
$position,
- $size
+ $size,
+ $text['rotation']
);
$text['position']->y += $size * $this->options->lineSpacing;
OpenPOWER on IntegriCloud