summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--src/driver/gd.php5
-rw-r--r--tests/data/compare/ezcGraphGdDriverTest_testDrawFullCircleSectorBug14655.pngbin0 -> 591 bytes
-rw-r--r--tests/driver_gd_test.php31
4 files changed, 36 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b303791..887d34f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,7 +4,7 @@
- Implemented feature #14400: Add shortcut to set background color
- Fixed #14651: Handle floor() floating point inaccuracies in numneric axis
step evaluation
-
+- Fixed #14655: A full circle sector is not drawn at all in GD driver.
1.4.1 - Monday 09 February 2009
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/driver/gd.php b/src/driver/gd.php
index f841f9d..763dda8 100644
--- a/src/driver/gd.php
+++ b/src/driver/gd.php
@@ -739,6 +739,11 @@ class ezcGraphGdDriver extends ezcGraphDriver
$endAngle = $tmp;
}
+ if ( ( $endAngle - $startAngle ) > 359.99999 )
+ {
+ return $this->drawCircle( $center, $width, $height, $color, $filled );
+ }
+
// 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.
diff --git a/tests/data/compare/ezcGraphGdDriverTest_testDrawFullCircleSectorBug14655.png b/tests/data/compare/ezcGraphGdDriverTest_testDrawFullCircleSectorBug14655.png
new file mode 100644
index 0000000..8b5d936
--- /dev/null
+++ b/tests/data/compare/ezcGraphGdDriverTest_testDrawFullCircleSectorBug14655.png
Binary files differ
diff --git a/tests/driver_gd_test.php b/tests/driver_gd_test.php
index 3a0d868..038837a 100644
--- a/tests/driver_gd_test.php
+++ b/tests/driver_gd_test.php
@@ -58,7 +58,7 @@ class ezcGraphGdDriverTest extends ezcTestImageCase
unset( $this->driver );
if ( !$this->hasFailed() )
{
- $this->removeTempDir();
+ // $this->removeTempDir();
}
}
@@ -424,6 +424,35 @@ class ezcGraphGdDriverTest extends ezcTestImageCase
);
}
+ public function testDrawFullCircleSectorBug14655()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.png';
+
+ // Draw filled cicle sector at ( 240.00, 95.00 ) with dimensions ( 144, 76 ) from 0.00 to 360.00.
+ $return = $this->driver->drawCircleSector(
+ new ezcGraphCoordinate( 100, 50 ),
+ 80,
+ 40,
+ 0.,
+ 360.,
+ ezcGraphColor::fromHex( '#3465A4' )
+ );
+
+ $this->driver->render( $filename );
+
+ $this->assertTrue(
+ file_exists( $filename ),
+ 'No image was generated.'
+ );
+
+ $this->assertImageSimilar(
+ $filename,
+ $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png',
+ 'Image does not look as expected.',
+ 2000
+ );
+ }
+
public function testDrawCircleSectorAcuteNonFilled()
{
$filename = $this->tempDir . __FUNCTION__ . '.png';
OpenPOWER on IntegriCloud