summaryrefslogtreecommitdiffstats
path: root/src/driver
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2008-07-18 09:56:33 +0000
committerKore Nordmann <github@kore-nordmann.de>2008-07-18 09:56:33 +0000
commit8e7c90a3ce6ffe407e83d7333f57f225f0c9a9a9 (patch)
tree171a45e3a9a21c3ecb4c80255884641c49dfb37c /src/driver
parent663755b520265cb1cc4bc3edf30370f54f16c86e (diff)
downloadzetacomponents-graph-8e7c90a3ce6ffe407e83d7333f57f225f0c9a9a9.zip
zetacomponents-graph-8e7c90a3ce6ffe407e83d7333f57f225f0c9a9a9.tar.gz
- Fixed issue #13361: Provided workaround for ext/GD bug:
http://bugs.php.net/45552
Diffstat (limited to 'src/driver')
-rw-r--r--src/driver/gd.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/driver/gd.php b/src/driver/gd.php
index 8f8a7f7..b0472e7 100644
--- a/src/driver/gd.php
+++ b/src/driver/gd.php
@@ -739,6 +739,28 @@ class ezcGraphGdDriver extends ezcGraphDriver
$endAngle = $tmp;
}
+ // Because of bug #45552 in PHPs ext/GD we check for a minimal distance
+ // on the outer border of the circle sector, and skip the drawing if
+ // the distance is lower then 1.
+ //
+ // See also: http://bugs.php.net/45552
+ $startPoint = new ezcGraphVector(
+ $center->x +
+ ( ( cos( deg2rad( $startAngle ) ) * $width ) / 2 ),
+ $center->y +
+ ( ( sin( deg2rad( $startAngle ) ) * $height ) / 2 )
+ );
+ if ( $startPoint->sub( new ezcGraphVector(
+ $center->x +
+ ( ( cos( deg2rad( $endAngle ) ) * $width ) / 2 ),
+ $center->y +
+ ( ( sin( deg2rad( $endAngle ) ) * $height ) / 2 )
+ ) )->length() < 1 )
+ {
+ // Skip this circle sector
+ return array();
+ }
+
if ( $filled )
{
imagefilledarc(
OpenPOWER on IntegriCloud