summaryrefslogtreecommitdiff
path: root/basegfx
diff options
context:
space:
mode:
authorChr. Rossmanith <ChrRossmanith@gmx.de>2012-05-18 22:41:33 +0200
committerChr. Rossmanith <ChrRossmanith@gmx.de>2012-12-08 10:29:18 +0100
commit0144c952282a4555b7ab0cfcf9d35bf753e5d8cb (patch)
tree29775b0fd88116764066583b40f1e0863403d60b /basegfx
parentf21e7f8d5875f0cb7592279ac515124b8ca7186c (diff)
SVG: add check if polygon is closed
Change-Id: I6e2b405dd1727fd6f6634fb0a68ccaf30d3644cf
Diffstat (limited to 'basegfx')
-rw-r--r--basegfx/source/polygon/b2dsvgpolypolygon.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/basegfx/source/polygon/b2dsvgpolypolygon.cxx b/basegfx/source/polygon/b2dsvgpolypolygon.cxx
index b73154308082..bb0b63a7cfc0 100644
--- a/basegfx/source/polygon/b2dsvgpolypolygon.cxx
+++ b/basegfx/source/polygon/b2dsvgpolypolygon.cxx
@@ -767,6 +767,10 @@ namespace basegfx
if(aCurrPoly.count())
{
+ const B2DPoint aFirstPoint(aCurrPoly.getB2DPoint(0));
+ const B2DPoint aLastPoint(aCurrPoly.getB2DPoint(aCurrPoly.count()-1));
+ if ( (aFirstPoint.getX()-aLastPoint.getX())*(aFirstPoint.getX()-aLastPoint.getX()) +
+ (aFirstPoint.getY()-aLastPoint.getY())*(aFirstPoint.getY()-aLastPoint.getY()) < 1 ) bIsClosed = true;
// end-process last poly
if(bIsClosed)
{