basegfx/source/polygon/b2dsvgpolypolygon.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 0144c952282a4555b7ab0cfcf9d35bf753e5d8cb
Author: Chr. Rossmanith <chrrossman...@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)
                 {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to