summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2007-05-25 09:29:33 +0000
committerKore Nordmann <github@kore-nordmann.de>2007-05-25 09:29:33 +0000
commit40967187c4276d08ade3efc26ded4a46d5085199 (patch)
treeaa37712cc321868d5bfdf6fb58762eef5b15da64 /tests
parent9d608ebc1f95c411add7ebdb3f4157d56ca9a7f9 (diff)
downloadzetacomponents-graph-40967187c4276d08ade3efc26ded4a46d5085199.zip
zetacomponents-graph-40967187c4276d08ade3efc26ded4a46d5085199.tar.gz
- Fixed issue #10846: Division by zero in polygon size reducement algorithm
for edges with an angle equals 0 degree.
Diffstat (limited to 'tests')
-rw-r--r--tests/data/compare/ezcGraphSvgDriverTest_testDrawPolygonBorderReducementWithRedundantPoints.svg2
-rw-r--r--tests/driver_svg_test.php23
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/data/compare/ezcGraphSvgDriverTest_testDrawPolygonBorderReducementWithRedundantPoints.svg b/tests/data/compare/ezcGraphSvgDriverTest_testDrawPolygonBorderReducementWithRedundantPoints.svg
new file mode 100644
index 0000000..44b39bf
--- /dev/null
+++ b/tests/data/compare/ezcGraphSvgDriverTest_testDrawPolygonBorderReducementWithRedundantPoints.svg
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="200" height="100" version="1.0" id="ezcGraph"><defs/><g id="ezcGraphChart" color-rendering="optimizeQuality" shape-rendering="geometricPrecision" text-rendering="optimizeLegibility"><path d=" M 10.0000,55.0000 L 10.0000,10.0000 L 10.0000,55.0000 z " style="fill: none; stroke: #3465a4; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphPolygon_1"/></g></svg>
diff --git a/tests/driver_svg_test.php b/tests/driver_svg_test.php
index 03e7734..67e0096 100644
--- a/tests/driver_svg_test.php
+++ b/tests/driver_svg_test.php
@@ -327,6 +327,29 @@ class ezcGraphSvgDriverTest extends ezcGraphTestCase
);
}
+ public function testDrawPolygonBorderReducementWithRedundantPoints()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.svg';
+
+ $this->driver->drawPolygon(
+ array(
+ new ezcGraphCoordinate( 10, 10 ),
+ new ezcGraphCoordinate( 10, 15 ),
+ new ezcGraphCoordinate( 10, 50 ),
+ new ezcGraphCoordinate( 10, 55 ),
+ ),
+ ezcGraphColor::fromHex( '#3465A4' ),
+ false
+ );
+
+ $this->driver->render( $filename );
+
+ $this->compare(
+ $filename,
+ $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'
+ );
+ }
+
public function testDrawCircleSectorAcuteNonFilled()
{
$filename = $this->tempDir . __FUNCTION__ . '.svg';
OpenPOWER on IntegriCloud