[Libreoffice-commits] .: basegfx/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sat Dec 8 05:10:18 PST 2012
basegfx/source/polygon/b2dsvgpolypolygon.cxx | 4 ++++
1 file changed, 4 insertions(+)
New commits:
commit 0144c952282a4555b7ab0cfcf9d35bf753e5d8cb
Author: Chr. Rossmanith <ChrRossmanith at gmx.de>
Date: Fri May 18 22:41:33 2012 +0200
SVG: add check if polygon is closed
Change-Id: I6e2b405dd1727fd6f6634fb0a68ccaf30d3644cf
diff --git a/basegfx/source/polygon/b2dsvgpolypolygon.cxx b/basegfx/source/polygon/b2dsvgpolypolygon.cxx
index b731543..bb0b63a 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)
{
More information about the Libreoffice-commits
mailing list