diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2008-06-18 09:48:07 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2008-06-18 09:48:07 +0000 |
commit | 56e1ea6d93e5a9327b1d14890e61c3d210cd2381 (patch) | |
tree | bcfd093ae07b0b3ce1c14a17dbe5ff1e2958bece /src/renderer | |
parent | 3f1e0ff648e5f70b90d2c2b0fbdb26ea6eafde1f (diff) | |
download | zetacomponents-graph-56e1ea6d93e5a9327b1d14890e61c3d210cd2381.zip zetacomponents-graph-56e1ea6d93e5a9327b1d14890e61c3d210cd2381.tar.gz |
- Implemented feature #13103: Different axes end styles
Diffstat (limited to 'src/renderer')
-rw-r--r-- | src/renderer/2d.php | 45 | ||||
-rw-r--r-- | src/renderer/3d.php | 42 |
2 files changed, 20 insertions, 67 deletions
diff --git a/src/renderer/2d.php b/src/renderer/2d.php index 5f6c477..1a5db3d 100644 --- a/src/renderer/2d.php +++ b/src/renderer/2d.php @@ -1320,42 +1320,17 @@ class ezcGraphRenderer2d ); // Draw small arrowhead - $size = max( - $axis->minArrowHeadSize, - min( - $axis->maxArrowHeadSize, - abs( ceil( ( ( $end->x - $start->x ) + ( $end->y - $start->y ) ) * $axis->axisSpace / 4 ) ) - ) - ); - - $orthogonalDirection = clone $direction; - $orthogonalDirection->rotateClockwise(); - - $this->driver->drawPolygon( - array( - new ezcGraphCoordinate( - $end->x, - $end->y - ), - new ezcGraphCoordinate( - $end->x - - $orthogonalDirection->x * $size / 2 - + $direction->x * $size, - $end->y - - $orthogonalDirection->y * $size / 2 - + $direction->y * $size - ), - new ezcGraphCoordinate( - $end->x - + $orthogonalDirection->x * $size / 2 - + $direction->x * $size, - $end->y - + $orthogonalDirection->y * $size / 2 - + $direction->y * $size - ), + $this->drawAxisArrowHead( + $end, + $direction, + max( + $axis->minArrowHeadSize, + min( + $axis->maxArrowHeadSize, + abs( ceil( ( ( $end->x - $start->x ) + ( $end->y - $start->y ) ) * $axis->axisSpace / 4 ) ) + ) ), - $axis->border, - true + $axis->border ); // Draw axis label diff --git a/src/renderer/3d.php b/src/renderer/3d.php index 8f34915..b860a1b 100644 --- a/src/renderer/3d.php +++ b/src/renderer/3d.php @@ -2119,39 +2119,17 @@ class ezcGraphRenderer3d ); // Draw small arrowhead - $size = max( - $axis->minArrowHeadSize, - min( - $axis->maxArrowHeadSize, - abs( ceil( ( ( $end->x - $start->x ) + ( $end->y - $start->y ) ) * $axis->axisSpace / 4 ) ) - ) - ); - - $orthogonalDirection = clone $direction; - $orthogonalDirection->rotateClockwise(); - - $this->driver->drawPolygon( - array( - $axisPolygonCoordinates[1], - new ezcGraphCoordinate( - $axisPolygonCoordinates[1]->x - - $orthogonalDirection->x * $size / 2 - + $direction->x * $size, - $axisPolygonCoordinates[1]->y - - $orthogonalDirection->y * $size / 2 - + $direction->y * $size - ), - new ezcGraphCoordinate( - $axisPolygonCoordinates[1]->x - + $orthogonalDirection->x * $size / 2 - + $direction->x * $size, - $axisPolygonCoordinates[1]->y - + $orthogonalDirection->y * $size / 2 - + $direction->y * $size - ), + $this->drawAxisArrowHead( + $axisPolygonCoordinates[1], + $direction, + max( + $axis->minArrowHeadSize, + min( + $axis->maxArrowHeadSize, + abs( ceil( ( ( $end->x - $start->x ) + ( $end->y - $start->y ) ) * $axis->axisSpace / 4 ) ) + ) ), - $axis->border, - true + $axis->border ); // Draw axis label |