summaryrefslogtreecommitdiffstats
path: root/src/math
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2007-03-29 12:20:03 +0000
committerKore Nordmann <github@kore-nordmann.de>2007-03-29 12:20:03 +0000
commitd96fa2d3668219a4105e986b3b75dd69a0d8ff37 (patch)
treeb123498c093978bcac9b0a30d38ad18099f1e1cf /src/math
parent46b36627ff6184fed301ab68c428a26ac5412cda (diff)
downloadzetacomponents-graph-d96fa2d3668219a4105e986b3b75dd69a0d8ff37.zip
zetacomponents-graph-d96fa2d3668219a4105e986b3b75dd69a0d8ff37.tar.gz
- Started implementing feature request #9404 (Rotated labels on axis)
# Works only with SVG driver now. # Angle needs to be set manually, no automatic optimal angle detection yet.
Diffstat (limited to 'src/math')
-rw-r--r--src/math/rotation.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/math/rotation.php b/src/math/rotation.php
index 13583df..cfd9866 100644
--- a/src/math/rotation.php
+++ b/src/math/rotation.php
@@ -44,6 +44,8 @@ class ezcGraphRotation extends ezcGraphTransformation
if ( $center === null )
{
+ $this->center = new ezcGraphCoordinate( 0, 0 );
+
$clockwiseRotation = deg2rad( $rotation );
$rotationMatrixArray = array(
array( cos( $clockwiseRotation ), -sin( $clockwiseRotation ), 0 ),
@@ -62,6 +64,26 @@ class ezcGraphRotation extends ezcGraphTransformation
$this->multiply( new ezcGraphRotation( $rotation ) );
$this->multiply( new ezcGraphTranslation( -$center->x, -$center->y ) );
}
+
+ /**
+ * Return rotaion angle in degrees
+ *
+ * @return float
+ */
+ public function getRotation()
+ {
+ return $this->rotation;
+ }
+
+ /**
+ * Return the center point of the current rotation
+ *
+ * @return ezcGraphCoordinate
+ */
+ public function getCenter()
+ {
+ return $this->center;
+ }
}
?>
OpenPOWER on IntegriCloud